]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
inet6: Just solicit when a router is unreachable
authorRoy Marples <roy@marples.name>
Sun, 25 Aug 2019 11:10:00 +0000 (12:10 +0100)
committerRoy Marples <roy@marples.name>
Sun, 25 Aug 2019 11:10:00 +0000 (12:10 +0100)
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.

src/ipv6.c
src/ipv6nd.c

index a024356cf617fab2cc7c2db35d5300de9e4f7079..31a0cae085661fd9454e8f2d53bb6f1698834cf5 100644 (file)
@@ -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)
index 0169caef3d8d6256068812ce37d02cda834c5da3..5f9c72cf3ff9d67372e2032391041a64bd01c224 100644 (file)
@@ -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;