]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When closing the IPv4LL state, close any timers as well.
authorRoy Marples <roy@marples.name>
Tue, 11 Nov 2014 09:17:06 +0000 (09:17 +0000)
committerRoy Marples <roy@marples.name>
Tue, 11 Nov 2014 09:17:06 +0000 (09:17 +0000)
arp.c
ipv4ll.c
ipv4ll.h

diff --git a/arp.c b/arp.c
index 8e39e73a9c85bb74c88f65ad6376743cc71271a7..49d6282e0dc4328adb051dd8011baa738e3a5b94 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -317,8 +317,10 @@ arp_free(struct arp_state *astate)
                eloop_timeout_delete(astate->iface->ctx->eloop, NULL, astate);
                state = D_STATE(astate->iface);
                TAILQ_REMOVE(&state->arp_states, astate, next);
-               if (state->arp_ipv4ll == astate)
+               if (state->arp_ipv4ll == astate) {
+                       ipv4ll_stop(astate->iface);
                        state->arp_ipv4ll = NULL;
+               }
                free(astate);
        }
 }
index 7bdd75ff20557dfcc21e53f65426f37bc0acf931..8d7c7af42fadb88ac4ef0ef4ec24accc4eaf0b96 100644 (file)
--- a/ipv4ll.c
+++ b/ipv4ll.c
@@ -249,3 +249,11 @@ ipv4ll_start(void *arg)
                astate->addr.s_addr = ipv4ll_pick_addr(astate);
        arp_probe(astate);
 }
+
+void
+ipv4ll_stop(struct interface *ifp)
+{
+       struct dhcp_state *state = D_STATE(ifp);
+
+       eloop_timeout_delete(ifp->ctx->eloop, NULL, state->arp_ipv4ll);
+}
index 803f63fd907a12cc0ab0cfb17f7c89532b3c15cc..54846dd02a2b4a0597dc4a9e99a9060116e0d869 100644 (file)
--- a/ipv4ll.h
+++ b/ipv4ll.h
@@ -31,5 +31,6 @@
 void ipv4ll_start(void *);
 void ipv4ll_claimed(void *);
 void ipv4ll_handle_failure(void *);
+void ipv4ll_stop(struct interface *);
 
 #endif