From: Roy Marples Date: Fri, 14 Nov 2014 07:16:49 +0000 (+0000) Subject: Add a guard to IPv4LL probed in case of an ARP race. X-Git-Tag: v6.6.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dced13fe96bc708179b985c5a5e1ca26ec225ea2;p=thirdparty%2Fdhcpcd.git Add a guard to IPv4LL probed in case of an ARP race. --- diff --git a/ipv4ll.c b/ipv4ll.c index 8cb6d2f3..99f78820 100644 --- a/ipv4ll.c +++ b/ipv4ll.c @@ -107,15 +107,17 @@ ipv4ll_probed(struct arp_state *astate) struct dhcp_state *state = D_STATE(astate->iface); struct dhcp_message *offer; - /* A DHCP lease could have already been offered. - * Backup this lease and replace once the IPv4LL addres is bound */ - offer = state->offer; - state->offer = ipv4ll_make_lease(astate->addr.s_addr); - if (state->offer == NULL) - syslog(LOG_ERR, "%s: %m", __func__); - else - dhcp_bind(astate->iface, astate); - state->offer = offer; + if (state->state != DHS_BOUND) { + /* A DHCP lease could have already been offered. + * Backup and replace once the IPv4LL addres is bound */ + offer = state->offer; + state->offer = ipv4ll_make_lease(astate->addr.s_addr); + if (state->offer == NULL) + syslog(LOG_ERR, "%s: %m", __func__); + else + dhcp_bind(astate->iface, astate); + state->offer = offer; + } } static void