From: Roy Marples Date: Sun, 24 May 2020 13:32:15 +0000 (+0100) Subject: dhcpcd: Fix releasing addresses X-Git-Tag: v9.1.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02966a545c28e6a043e66d187c1dedc91c211145;p=thirdparty%2Fdhcpcd.git dhcpcd: Fix releasing addresses --- 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); } }