]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix expire and re-solicit on drop
authorRoy Marples <roy@marples.name>
Fri, 12 Sep 2014 13:26:28 +0000 (13:26 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Sep 2014 13:26:28 +0000 (13:26 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index d0dcb60cfc91044cd296dd375cf5d028d32d0e0e..19b131149dad5108e855219d2978fe320d204067 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -123,6 +123,8 @@ struct udp_dhcp_packet
 
 static const size_t udp_dhcp_len = sizeof(struct udp_dhcp_packet);
 
+static int dhcp_open(struct interface *ifp);
+
 void
 dhcp_printoptions(const struct dhcpcd_ctx *ctx,
     const struct dhcp_opt *opts, size_t opts_len)
@@ -1586,6 +1588,9 @@ send_message(struct interface *iface, uint8_t type,
                    timeval_to_double(&tv));
        }
 
+       if (dhcp_open(iface) == -1)
+               return;
+
        if (state->addr.s_addr != INADDR_ANY &&
            state->new != NULL &&
            (state->new->cookie == htonl(MAGIC_COOKIE) ||
@@ -2140,7 +2145,7 @@ dhcp_drop(struct interface *ifp, const char *reason)
        dhcp_auth_reset(&state->auth);
        dhcp_close(ifp);
        arp_close(ifp);
-       eloop_timeouts_delete(ifp->ctx->eloop, ifp, dhcp_expire, NULL);
+       eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
        if (ifp->options->options & DHCPCD_RELEASE) {
                unlink(state->leasefile);
                if (ifp->carrier != LINK_DOWN &&