When closing the IPv4LL state, close any timers as well.

This commit is contained in:
Roy Marples 2014-11-11 09:17:06 +00:00
parent 5b3ae33d33
commit fac143bfd1
3 changed files with 12 additions and 1 deletions

4
arp.c
View File

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

View File

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

View File

@ -31,5 +31,6 @@
void ipv4ll_start(void *);
void ipv4ll_claimed(void *);
void ipv4ll_handle_failure(void *);
void ipv4ll_stop(struct interface *);
#endif