From: Roy Marples Date: Fri, 24 Oct 2014 19:25:04 +0000 (+0000) Subject: When binding a non IPv4LL address, kill the IPV4LL state. X-Git-Tag: v6.6.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca0ea4d2f7e04d82bfc27dbd30330c3a96ed7c90;p=thirdparty%2Fdhcpcd.git When binding a non IPv4LL address, kill the IPV4LL state. --- diff --git a/arp.c b/arp.c index 0db52c14..f4f64479 100644 --- a/arp.c +++ b/arp.c @@ -313,9 +313,11 @@ arp_free(struct arp_state *astate) { struct dhcp_state *state; - state = D_STATE(astate->iface); - TAILQ_REMOVE(&state->arp_states, astate, next); - free(astate); + if (astate) { + state = D_STATE(astate->iface); + TAILQ_REMOVE(&state->arp_states, astate, next); + free(astate); + } } void diff --git a/dhcp.c b/dhcp.c index 9cbd8bf0..d2346108 100644 --- a/dhcp.c +++ b/dhcp.c @@ -1970,8 +1970,13 @@ applyaddr: astate->announced_cb = dhcp_arp_announced; } - if (astate) + if (astate) { arp_announce(astate); + if (astate != state->arp_ipv4ll) { + arp_free(state->arp_ipv4ll); + state->arp_ipv4ll = NULL; + } + } } else if (!ipv4ll) arp_close(ifp); }