]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't special case not deleteing the IPv6 default route.
authorRoy Marples <roy@marples.name>
Tue, 3 Oct 2017 11:00:52 +0000 (12:00 +0100)
committerRoy Marples <roy@marples.name>
Tue, 3 Oct 2017 11:00:52 +0000 (12:00 +0100)
dhcpcd now manages this the same as any other route as dhcpcd is
either in charge of IPv6 or it's not.

src/route.c

index 09f88736cabe61f8e5f32b1e4ce82314a56c1be6..29ca47ebc98be8bf206dc69e7a7bf5223d04a028 100644 (file)
@@ -464,9 +464,6 @@ rt_build(struct dhcpcd_ctx *ctx, int af)
        struct rt_head routes, added;
        struct rt *rt, *rtn;
        unsigned long long o;
-#ifdef INET6
-       bool have_default = false;
-#endif
 
        /* We need to have the interfaces in the correct order to ensure
         * our routes are managed correctly. */
@@ -500,17 +497,10 @@ rt_build(struct dhcpcd_ctx *ctx, int af)
                if (rt_doroute(rt)) {
                        TAILQ_REMOVE(&routes, rt, rt_next);
                        TAILQ_INSERT_TAIL(&added, rt, rt_next);
-#ifdef INET6
-                       if (sa_is_unspecified(&rt->rt_dest) &&
-                           sa_is_unspecified(&rt->rt_netmask))
-                               have_default = true;
-#endif
                }
        }
 
-       /* Remove old routes we used to manage
-        * If we own the default route, but not RA management itself
-        * then we need to preserve the last best default route we had */
+       /* Remove old routes we used to manage. */
        TAILQ_FOREACH_SAFE(rt, &ctx->routes, rt_next, rtn) {
                if (rt->rt_dest.sa_family != af &&
                    rt->rt_gateway.sa_family != af)
@@ -520,16 +510,6 @@ rt_build(struct dhcpcd_ctx *ctx, int af)
                        o = rt->rt_ifp->options ?
                            rt->rt_ifp->options->options :
                            ctx->options;
-#ifdef INET6
-                       if (!have_default &&
-                           rt->rt_dest.sa_family == AF_INET6 &&
-                           sa_is_unspecified(&rt->rt_dest))
-                               have_default = true;
-                               /* no need to add it back to our routing table
-                                * as we delete an exiting route when we add
-                                * a new one */
-                       else
-#endif
                        if ((o &
                                (DHCPCD_EXITING | DHCPCD_PERSISTENT)) !=
                                (DHCPCD_EXITING | DHCPCD_PERSISTENT))