diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib_ft.c b/sys/net/gnrc/network_layer/ipv6/nib/nib_ft.c index 4b4a965bd7..2268034327 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib_ft.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib_ft.c @@ -100,8 +100,9 @@ bool gnrc_ipv6_nib_ft_iter(const ipv6_addr_t *next_hop, unsigned iface, _nib_offl_entry_t *offl = *state; while ((offl = _nib_offl_iter(offl))) { - assert((offl->mode != 0) || (offl->next_hop != NULL)); - if (((iface == 0) || (iface == _nib_onl_get_if(offl->next_hop))) && + assert(offl->mode != 0); + if ((offl->next_hop != NULL) && + ((iface == 0) || (iface == _nib_onl_get_if(offl->next_hop))) && ((next_hop == NULL) || ipv6_addr_equal(&offl->next_hop->ipv6, next_hop))) { _nib_ft_get(offl, fte); @@ -113,8 +114,8 @@ bool gnrc_ipv6_nib_ft_iter(const ipv6_addr_t *next_hop, unsigned iface, } entry = *state; while ((entry = _nib_drl_iter(entry))) { - assert((entry->next_hop != NULL)); - if (((iface == 0) || (iface == _nib_onl_get_if(entry->next_hop))) && + if ((entry->next_hop != NULL) && + ((iface == 0) || (iface == _nib_onl_get_if(entry->next_hop))) && ((next_hop == NULL) || ipv6_addr_equal(&entry->next_hop->ipv6, next_hop))) { _nib_drl_ft_get(entry, fte); diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c b/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c index 635d9dec0d..125582a2a7 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c @@ -81,8 +81,7 @@ bool gnrc_ipv6_nib_pl_iter(unsigned iface, void **state, mutex_lock(&_nib_mutex); while ((dst = _nib_offl_iter(dst)) != NULL) { const _nib_onl_entry_t *node = dst->next_hop; - assert(node != NULL); - if ((dst->mode & _PL) && + if ((node != NULL) && (dst->mode & _PL) && ((iface == 0) || (_nib_onl_get_if(node) == iface))) { entry->pfx_len = dst->pfx_len; ipv6_addr_set_unspecified(&entry->pfx);