diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index 68d10ce224..a4dfcd1d52 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -72,9 +72,6 @@ static void _send(gnrc_pktsnip_t *pkt, bool prep_hdr); /* Main event loop for IPv6 */ static void *_event_loop(void *args); -/* Handles encapsulated IPv6 packets: http://tools.ietf.org/html/rfc2473 */ -static void _decapsulate(gnrc_pktsnip_t *pkt); - kernel_pid_t gnrc_ipv6_init(void) { if (gnrc_ipv6_pid == KERNEL_PID_UNDEF) { @@ -128,11 +125,6 @@ void gnrc_ipv6_demux(gnrc_netif_t *netif, gnrc_pktsnip_t *current, break; #endif - case PROTNUM_IPV6: - assert(current == pkt); - interested = true; - - break; default: (void)netif; #ifdef MODULE_GNRC_SIXLOWPAN_IPHC_NHC @@ -181,10 +173,6 @@ void gnrc_ipv6_demux(gnrc_netif_t *netif, gnrc_pktsnip_t *current, return; #endif - case PROTNUM_IPV6: - DEBUG("ipv6: handle encapsulated IPv6 packet (nh = %u)\n", nh); - _decapsulate(pkt); - return; default: assert(false); break; @@ -213,11 +201,9 @@ static void _dispatch_next_header(gnrc_pktsnip_t *current, gnrc_pktsnip_t *pkt, { #ifdef MODULE_GNRC_IPV6_EXT const bool should_dispatch_current_type = ((current->type != GNRC_NETTYPE_IPV6_EXT) || - (current->next->type == GNRC_NETTYPE_IPV6)) && - (current->type != GNRC_NETTYPE_IPV6); + (current->next->type == GNRC_NETTYPE_IPV6)); #else - const bool should_dispatch_current_type = (current->next->type == GNRC_NETTYPE_IPV6) && - (current->type != GNRC_NETTYPE_IPV6); + const bool should_dispatch_current_type = (current->next->type == GNRC_NETTYPE_IPV6); #endif DEBUG("ipv6: forward nh = %u to other threads\n", nh); @@ -880,24 +866,4 @@ static void _receive(gnrc_pktsnip_t *pkt) gnrc_ipv6_demux(netif, pkt, pkt, hdr->nh); } -static void _decapsulate(gnrc_pktsnip_t *pkt) -{ - gnrc_pktsnip_t *ptr = pkt; - - pkt->type = GNRC_NETTYPE_UNDEF; /* prevent payload (the encapsulated packet) - * from being removed */ - - /* Remove encapsulating IPv6 header */ - while ((ptr->next != NULL) && (ptr->next->type == GNRC_NETTYPE_IPV6)) { - gnrc_pktbuf_remove_snip(pkt, pkt->next); - } - - pkt->type = GNRC_NETTYPE_IPV6; - - if (gnrc_netapi_dispatch_receive(GNRC_NETTYPE_IPV6, - GNRC_NETREG_DEMUX_CTX_ALL, pkt) == 0) { - gnrc_pktbuf_release(pkt); - } -} - /** @} */