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. */
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)
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))