Remove IPv4 routes in reverse order to match IPv6.

Thanks to Guy Yur.
This commit is contained in:
Roy Marples 2016-09-03 12:23:03 +00:00
parent cf5305c098
commit 5b7f4be8cb

2
ipv4.c
View File

@ -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)) !=