]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If we reboot an IPv4LL address, start DHCP negotiation right away.
authorRoy Marples <roy@marples.name>
Tue, 3 Mar 2009 23:41:53 +0000 (23:41 +0000)
committerRoy Marples <roy@marples.name>
Tue, 3 Mar 2009 23:41:53 +0000 (23:41 +0000)
arp.c
dhcpcd.c

diff --git a/arp.c b/arp.c
index 20873187ca2044a3ecf7351a54c577586b1be372..3eac18c0b01498d3431e70c1bf032bb8362a36a4 100644 (file)
--- 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;
index 327aa9354827e3604cb8fbd0d0ee74d6dc179d9e..0436104d5bbe24d987d33db2d2161e5c0f844cc9 100644 (file)
--- 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);
 }