From: Roy Marples Date: Mon, 10 Nov 2014 19:23:52 +0000 (+0000) Subject: Reset DHCP state when the interface is departing. X-Git-Tag: v6.6.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b3ae33d3310ce6baa4e69b06efcb7c6feef2b3d;p=thirdparty%2Fdhcpcd.git Reset DHCP state when the interface is departing. --- diff --git a/dhcp.c b/dhcp.c index 4830cecc..97dd1b89 100644 --- 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);