summaryrefslogtreecommitdiffstats
path: root/src/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-08-30 11:06:20 +0100
committerRoy Marples <roy@marples.name>2019-08-30 11:06:20 +0100
commit2c340935edbe3a6e9b1ff50ff7f9f23414986180 (patch)
tree57a57bf549309a1a1c4a2044a00aad5db6a61252 /src/if-bsd.c
parent9dff4f78f2ac04d207953982cb649ac927eb4f07 (diff)
downloaddhcpcd-2c340935edbe3a6e9b1ff50ff7f9f23414986180.tar.xz
inet6: Stop reacting to kernel neighbour messages about a router
It's unreliable and very corner case. See the comment for the ipv6nd_neighbour() function.
Diffstat (limited to 'src/if-bsd.c')
-rw-r--r--src/if-bsd.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c
index ed5041d5..47219e1a 100644
--- a/src/if-bsd.c
+++ b/src/if-bsd.c
@@ -1083,20 +1083,17 @@ if_rtm(struct dhcpcd_ctx *ctx, const struct rt_msghdr *rtm)
* BSD announces host routes.
* As such, we should be notified of reachability by its
* existance with a hardware address.
- * Ensure we don't call this for an incomplete state.
+ * Ensure we don't call this for a newly incomplete state.
*/
if (rt.rt_dest.sa_family == AF_INET6 &&
rt.rt_flags & RTF_HOST &&
!(rtm->rtm_type == RTM_ADD && !(rt.rt_dflags & RTDF_GATELINK)))
{
- int flags = 0;
+ bool reachable;
- if (rt.rt_dflags & RTDF_GATELINK)
- flags |= IPV6ND_ROUTER;
- if (rtm->rtm_type != RTM_DELETE)
- flags |= IPV6ND_REACHABLE;
-
- ipv6nd_neighbour(ctx, &rt.rt_ss_dest.sin6.sin6_addr, flags);
+ reachable = rtm->rtm_type != RTM_DELETE &&
+ rt.rt_dflags & RTDF_GATELINK;
+ ipv6nd_neighbour(ctx, &rt.rt_ss_dest.sin6.sin6_addr, reachable);
}
#endif