From: Roy Marples Date: Tue, 3 Oct 2017 11:00:52 +0000 (+0100) Subject: Don't special case not deleteing the IPv6 default route. X-Git-Tag: v7.0.0-rc3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30479daad8e9c3618406a021dca201d27277aca8;p=thirdparty%2Fdhcpcd.git Don't special case not deleteing the IPv6 default route. dhcpcd now manages this the same as any other route as dhcpcd is either in charge of IPv6 or it's not. --- diff --git a/src/route.c b/src/route.c index 09f88736..29ca47eb 100644 --- a/src/route.c +++ b/src/route.c @@ -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))