From: Roy Marples Date: Tue, 3 Mar 2009 23:41:53 +0000 (+0000) Subject: If we reboot an IPv4LL address, start DHCP negotiation right away. X-Git-Tag: v5.0.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=746e44f9c2425916efb61485ae22cf67b9a38408;p=thirdparty%2Fdhcpcd.git If we reboot an IPv4LL address, start DHCP negotiation right away. --- diff --git a/arp.c b/arp.c index 20873187..3eac18c0 100644 --- a/arp.c +++ b/arp.c @@ -193,8 +193,9 @@ send_arp_announce(void *arg) } if (IN_LINKLOCAL(htonl(state->new->yiaddr))) { /* We should pretend to be at the end - * of the DHCP negotation cycle */ - state->interval = 64; + * of the DHCP negotation cycle unless we rebooted */ + if (state->interval != 0) + state->interval = 64; state->probes = 0; state->claims = 0; tv.tv_sec = state->interval - DHCP_RAND_MIN; diff --git a/dhcpcd.c b/dhcpcd.c index 327aa935..0436104d 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -364,9 +364,9 @@ start_expire(void *arg) { struct interface *iface = arg; + iface->state->interval = 0; if (iface->addr.s_addr == 0) { /* We failed to reboot, so enter discovery. */ - iface->state->interval = 0; start_discover(iface); return; } @@ -375,7 +375,6 @@ start_expire(void *arg) delete_timeout(NULL, iface); drop_config(iface, "EXPIRE"); unlink(iface->leasefile); - iface->state->interval = 0; if (iface->carrier != LINK_DOWN) start_interface(iface); }