]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove IPv4 routes in reverse order to match IPv6.
authorRoy Marples <roy@marples.name>
Sat, 3 Sep 2016 12:23:03 +0000 (12:23 +0000)
committerRoy Marples <roy@marples.name>
Sat, 3 Sep 2016 12:23:03 +0000 (12:23 +0000)
Thanks to Guy Yur.

ipv4.c

diff --git a/ipv4.c b/ipv4.c
index 4d31090157012a0206d25ea3007c4af3a3954232..dbe04899cf2ebaf06f8badad27f9834283765107 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -857,7 +857,7 @@ ipv4_buildroutes(struct dhcpcd_ctx *ctx)
 
        /* Remove old routes we used to manage */
        if (ctx->ipv4_routes) {
-               TAILQ_FOREACH(rt, ctx->ipv4_routes, next) {
+               TAILQ_FOREACH_REVERSE(rt, ctx->ipv4_routes, rt_head, next) {
                        if (find_route(nrs, rt, NULL) == NULL &&
                            (rt->iface->options->options &
                            (DHCPCD_EXITING | DHCPCD_PERSISTENT)) !=