]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Reset DHCP state when the interface is departing.
authorRoy Marples <roy@marples.name>
Mon, 10 Nov 2014 19:23:52 +0000 (19:23 +0000)
committerRoy Marples <roy@marples.name>
Mon, 10 Nov 2014 19:23:52 +0000 (19:23 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 4830cecc8f9745bf6932920f9a8425a80c05247d..97dd1b89b34031263e97074581d49feef06b83c8 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2172,8 +2172,12 @@ dhcp_drop(struct interface *ifp, const char *reason)
                eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
                return;
        }
-       /* Don't reset DHCP state if we have an IPv4LL address and link is up */
-       if (state->state != DHS_IPV4LL_BOUND || ifp->carrier != LINK_UP) {
+       /* Don't reset DHCP state if we have an IPv4LL address and link is up,
+        * unless the interface is departing. */
+       if (state->state != DHS_IPV4LL_BOUND ||
+           ifp->carrier != LINK_UP ||
+           ifp->options->options & DHCPCD_DEPARTED)
+       {
                eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
                dhcp_auth_reset(&state->auth);
                dhcp_close(ifp);