From: Roy Marples Date: Wed, 27 Jul 2016 05:29:09 +0000 (+0000) Subject: Fix expiration of a single default router with static routes. X-Git-Tag: v6.11.2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72ff5c6e879da6ae40edfa635e18690592546c7a;p=thirdparty%2Fdhcpcd.git Fix expiration of a single default router with static routes. --- diff --git a/ipv6.c b/ipv6.c index 1561497b..988080df 100644 --- a/ipv6.c +++ b/ipv6.c @@ -2434,11 +2434,14 @@ ipv6_buildroutes(struct dhcpcd_ctx *ctx) /* Should static take priority? */ ipv6_build_static_routes(ctx, &dnr); +#ifdef HAVE_ROUTE_METRIC + rt = TAILQ_LAST(&dnr, rt6_head); +#endif /* First add reachable routers and their prefixes */ ipv6_build_ra_routes(ctx->ipv6, &dnr, 0); #ifdef HAVE_ROUTE_METRIC - have_default = (TAILQ_FIRST(&dnr) != NULL); + have_default = (rt != TAILQ_LAST(&dnr, rt6_head)); #endif /* We have no way of knowing if prefixes added by DHCP are reachable