From a09072c93dc8661a8cf321106a85fce02c5bb27b Mon Sep 17 00:00:00 2001 From: Martine Sophie Lenders Date: Tue, 18 Jun 2019 11:45:16 +0200 Subject: [PATCH] gnrc_ipv6_nib: add address from netif to address validation timer The `addr` parameter of the NIB's `_handle_dad()` function can come from anywhere (e.g. in the fallback to classic SLAAC the destination address of the IP header is used), so putting that pointer in a timer is not a good idea. Instead we use the version of the address that is stored within the interface. --- sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c index 51c77b6b45..c27b2199dd 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c @@ -178,7 +178,8 @@ void _handle_dad(const ipv6_addr_t *addr) if (idx >= 0) { ipv6_addr_set_solicited_nodes(&sol_nodes, addr); _snd_ns(addr, netif, &ipv6_addr_unspecified, &sol_nodes); - _evtimer_add((void *)addr, GNRC_IPV6_NIB_VALID_ADDR, + _evtimer_add((void *)&netif->ipv6.addrs[idx], + GNRC_IPV6_NIB_VALID_ADDR, &netif->ipv6.addrs_timers[idx], netif->ipv6.retrans_time); }