From 02966a545c28e6a043e66d187c1dedc91c211145 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 24 May 2020 14:32:15 +0100 Subject: [PATCH] dhcpcd: Fix releasing addresses --- src/dhcpcd.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/dhcpcd.c b/src/dhcpcd.c index c81637f1..86a4f299 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -384,7 +384,6 @@ dhcpcd_daemonise(struct dhcpcd_ctx *ctx) static void dhcpcd_drop(struct interface *ifp, int stop) { - return; #ifdef DHCP6 dhcp6_drop(ifp, stop ? NULL : "EXPIRE6"); @@ -1347,13 +1346,13 @@ stop_all_interfaces(struct dhcpcd_ctx *ctx, unsigned long long opts) ctx->options |= DHCPCD_EXITING; /* Drop the last interface first */ TAILQ_FOREACH_REVERSE(ifp, ctx->ifaces, if_head, next) { - if (ifp->active) { - ifp->options->options |= opts; - if (ifp->options->options & DHCPCD_RELEASE) - ifp->options->options &= ~DHCPCD_PERSISTENT; - ifp->options->options |= DHCPCD_EXITING; - stop_interface(ifp); - } + if (!ifp->active) + continue; + ifp->options->options |= opts; + if (ifp->options->options & DHCPCD_RELEASE) + ifp->options->options &= ~DHCPCD_PERSISTENT; + ifp->options->options |= DHCPCD_EXITING; + stop_interface(ifp); } } -- 2.47.2