]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix the case where we lose carrier between IPv4 delay and starting a new
authorRoy Marples <roy@marples.name>
Fri, 17 Oct 2014 19:45:25 +0000 (19:45 +0000)
committerRoy Marples <roy@marples.name>
Fri, 17 Oct 2014 19:45:25 +0000 (19:45 +0000)
state.

dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 1e1cd66bc04c808f88f7af5cb95efd88bbf57a2e..9131ba69b60f7dd02ca7fa59ce83d7aad74fa0ef 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -2159,13 +2159,16 @@ dhcp_drop(struct interface *ifp, const char *reason)
        struct timespec ts;
 #endif
 
+       /* dhcp_start may just have been called and we don't yet have a state
+        * but we do have a timeout, so punt it. */
+       eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
+
        state = D_STATE(ifp);
        if (state == NULL)
                return;
        dhcp_auth_reset(&state->auth);
        dhcp_close(ifp);
        arp_close(ifp);
-       eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
        if (ifp->options->options & DHCPCD_RELEASE) {
                unlink(state->leasefile);
                if (ifp->carrier != LINK_DOWN &&