From 72ff5c6e879da6ae40edfa635e18690592546c7a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 27 Jul 2016 05:29:09 +0000 Subject: [PATCH] Fix expiration of a single default router with static routes. --- ipv6.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.47.3