From: Roy Marples Date: Sun, 25 Aug 2019 11:10:00 +0000 (+0100) Subject: inet6: Just solicit when a router is unreachable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7827e357ea2e847cb34d7e46cfb9b5db67637e8;p=thirdparty%2Fdhcpcd.git inet6: Just solicit when a router is unreachable We shouldn't take the default route away as there could be valid reasons, such as the default route changing interface. Instead, just solicit another router if there are no valid routers on the interface. --- diff --git a/src/ipv6.c b/src/ipv6.c index a024356c..31a0cae0 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -2271,7 +2271,7 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx) rt_proto_add(routes, rt); } } - if (rap->lifetime == 0 || !rap->isreachable) + if (rap->lifetime == 0) continue; rt = inet6_makerouter(rap); if (rt == NULL) diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 0169caef..5f9c72cf 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -127,7 +127,6 @@ __CTASSERT(sizeof(struct nd_opt_rdnss) == 8); // static void ipv6nd_handledata(void *); -static void ipv6nd_startrs1(void *); /* * Android ships buggy ICMP6 filter headers. @@ -576,10 +575,6 @@ ipv6nd_reachable(struct ra *rap, int flags) rap->iface->name, rap->sfrom); rap->isreachable = false; } - - rt_build(rap->iface->ctx, AF_INET6); - /* XXX Not really an RA */ - script_runreason(rap->iface, "ROUTERADVERT"); } void @@ -608,7 +603,7 @@ ipv6nd_neighbour(struct dhcpcd_ctx *ctx, struct in6_addr *addr, int flags) } if (rapr == NULL) - ipv6nd_startrs1(rap->iface); + ipv6nd_startrs(rap->iface); } const struct ipv6_addr * @@ -1427,9 +1422,6 @@ ipv6nd_env(FILE *fp, const struct interface *ifp) if (efprintf(fp, "%s_now=%lld", ndprefix, (long long)now.tv_sec) == -1) return -1; - if (efprintf(fp, "%s_isreachable=%s", ndprefix, - rap->isreachable ? "true" : "false") == -1) - return -1; /* Zero our indexes */ for (j = 0, opt = rap->iface->ctx->nd_opts;