From ae4165b3740e8b3fc43a7f2c25a86fb61c4e3762 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 14 Jun 2021 16:56:15 +0200 Subject: [PATCH] gnrc_ipv6_nib: get node from proper interface If we switch the interface in gnrc_ipv6_nib_get_next_hop_l2addr() we must also re-get the nib entry from the 'proper' interface. Otherwise we will always find the host unreachable on the 'wrong' interface. --- sys/net/gnrc/network_layer/ipv6/nib/nib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c index 54cc69f9e9..e2000a4086 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c @@ -228,6 +228,10 @@ int gnrc_ipv6_nib_get_next_hop_l2addr(const ipv6_addr_t *dst, /* release pre-assumed netif */ gnrc_netif_release(netif); netif = _acquire_new_iface(iface); + /* get node from proper interface */ + if (netif != NULL) { + node = _nib_onl_get(dst, netif->pid); + } } if ((netif == NULL) || !_resolve_addr(dst, netif, pkt, nce, node)) {