diff --git a/sys/include/net/gnrc/ipv6.h b/sys/include/net/gnrc/ipv6.h index deb8536f37..03b89cb8aa 100644 --- a/sys/include/net/gnrc/ipv6.h +++ b/sys/include/net/gnrc/ipv6.h @@ -14,7 +14,10 @@ * The IPv6 control thread understands messages of type * * * @ref GNRC_NETAPI_MSG_TYPE_RCV, and - * * @ref GNRC_NETAPI_MSG_TYPE_SND, + * * @ref GNRC_NETAPI_MSG_TYPE_SND. + * + * If the message is of type @ref GNRC_NETAPI_MSG_TYPE_RCV the provided @ref + * gnrc_pktsnip_t must contain a snip of type @ref GNRC_NETTYPE_NETIF. * * @{ * diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index fa70ab10bf..57cc9ca585 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -764,9 +764,8 @@ static void _receive(gnrc_pktsnip_t *pkt) netif = gnrc_pktsnip_search_type(pkt, GNRC_NETTYPE_NETIF); - if (netif != NULL) { - iface = ((gnrc_netif_hdr_t *)netif->data)->if_pid; - } + assert(netif); + iface = ((gnrc_netif_hdr_t *)netif->data)->if_pid; first_ext = pkt;