From: Roy Marples Date: Fri, 3 Apr 2020 18:05:41 +0000 (+0000) Subject: Linux: improve IPv6 router reachability X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2029fbaea8feddc81be25cbe3f30b983909b44d4;p=thirdparty%2Fdhcpcd.git Linux: improve IPv6 router reachability Only mark as unreachable for NUD_FAILED. Sadly the kernel emits this when the NDP entry is deleted for whatever reason, which looks like a bug in the kernel. --- diff --git a/src/if-linux.c b/src/if-linux.c index fe39dcb6..8b8fe973 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -820,13 +820,11 @@ link_neigh(struct dhcpcd_ctx *ctx, __unused struct interface *ifp, rta = RTM_RTA(r); len = RTM_PAYLOAD(nlm); if (r->ndm_family == AF_INET6) { - bool reachable; + bool unreachable; struct in6_addr addr6; - reachable = (nlm->nlmsg_type == RTM_NEWNEIGH && - r->ndm_state & - (NUD_REACHABLE | NUD_STALE | NUD_DELAY | NUD_PROBE | - NUD_PERMANENT)); + unreachable = (nlm->nlmsg_type == RTM_NEWNEIGH && + r->ndm_state & NUD_FAILED); memset(&addr6, 0, sizeof(addr6)); for (; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { switch (rta->rta_type) { @@ -836,7 +834,7 @@ link_neigh(struct dhcpcd_ctx *ctx, __unused struct interface *ifp, break; } } - ipv6nd_neighbour(ctx, &addr6, reachable); + ipv6nd_neighbour(ctx, &addr6, !unreachable); } return 0;