From 660440c1c2b0c251a9ee0cd8ba6b6a0594af07ca Mon Sep 17 00:00:00 2001 From: Martine Lenders <m.lenders@fu-berlin.de> Date: Fri, 8 Feb 2019 16:44:02 +0100 Subject: [PATCH] gnrc_ipv6_nib/nc: remove from _next_removable on remove The `_next_removable` list manages the cache-out of the neighbor cache. However, when a neighbor cache entry is removed, it is not removed from that list, which may lead to a segmentation fault when that list is accessed, since the whole entry (including its list pointer) is zeroed after removal. With this change the entry is removed from that list accordingly before the zeroing happens. --- sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c index 1cd5c1988b..acea7db365 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c @@ -272,6 +272,8 @@ void _nib_nc_remove(_nib_onl_entry_t *node) entry->pkt = NULL; } #endif /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */ + /* remove from cache-out procedure */ + clist_remove(&_next_removable, (clist_node_t *)node); _nib_onl_clear(node); } -- GitLab