]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Always expire lease on probe failure. We should do this as the LAN we hot swap too...
authorRoy Marples <roy@marples.name>
Tue, 22 Jul 2008 06:58:11 +0000 (06:58 +0000)
committerRoy Marples <roy@marples.name>
Tue, 22 Jul 2008 06:58:11 +0000 (06:58 +0000)
client.c

index d43d2d53a93bec9b3c931bb8957e52cc9b2fd0e1..64d604f3c3a1849f45d4da939a410bb6f0edc8bd 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1593,17 +1593,21 @@ handle_arp_fail(struct if_state *state, const struct options *options)
        time_t up;
 
        if (IN_LINKLOCAL(htonl(state->fail.s_addr))) {
-               if (state->fail.s_addr == state->interface->addr.s_addr &&
-                   state->state != STATE_PROBING)
-               {
-                       up = uptime();
-                       if (state->defend + DEFEND_INTERVAL > up) {
-                               drop_config(state, "FAIL", options);
-                               state->conflicts = -1;
-                               /* drop through to set conflicts to 0 */
-                       } else {
-                               state->defend = up;
-                               return 0;
+               if (state->fail.s_addr == state->interface->addr.s_addr) {
+                       if (state->state == STATE_PROBING)
+                               /* This should only happen when SIGALRM or
+                                * link when down/up and we have a conflict. */
+                               drop_config(state, "EXPIRE", options);
+                       else {
+                               up = uptime();
+                               if (state->defend + DEFEND_INTERVAL > up) {
+                                       drop_config(state, "EXPIRE", options);
+                                       state->conflicts = -1;
+                                       /* drop through to set conflicts to 0 */
+                               } else {
+                                       state->defend = up;
+                                       return 0;
+                               }
                        }
                }
                do_socket(state, SOCKET_CLOSED);