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);