[riot-notifications] [RIOT-OS/RIOT] gnrc/nib: only consider neighbor cache entries in _nib_onl_get() (#16671)

benpicco notifications at github.com
Thu Jul 22 11:48:51 CEST 2021

Ok, so I think the 'real patch' should be

--- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c
+++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c
@@ -220,7 +220,7 @@ int gnrc_ipv6_nib_get_next_hop_l2addr(const ipv6_addr_t *dst,
         /* consider neighbor cache entries first */
         unsigned iface = (node == NULL) ? 0 : _nib_onl_get_if(node);
-        if ((node != NULL) || _on_link(dst, &iface)) {
+        if (((node != NULL) && (nce->mode & _NC)) || _on_link(dst, &iface)) {
             DEBUG("nib: %s is on-link or in NC, start address resolution\n",
                   ipv6_addr_to_str(addr_str, dst, sizeof(addr_str)));
             /* on-link prefixes return their interface */

Then I was wondering if it even makes sense for `_nib_onl_get()` to return non-NC entries as all on-link entries should also be in the neighbor cache. 

If I'm wrong I can also add a `_nib_onl_nc_get()` and simplify some of the code that manually checks for the `_NC` flag now.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210722/f80f51b4/attachment.htm>

More information about the notifications mailing list