]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix expiration of a single default router with static routes.
authorRoy Marples <roy@marples.name>
Wed, 27 Jul 2016 05:29:09 +0000 (05:29 +0000)
committerRoy Marples <roy@marples.name>
Wed, 27 Jul 2016 05:29:09 +0000 (05:29 +0000)
ipv6.c

diff --git a/ipv6.c b/ipv6.c
index 1561497b27ad320270ae4aee48f11f8456f9bb46..988080dfe18f255128ddc1d0ba264d9e183f7e3c 100644 (file)
--- 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