dhclient - Lets state_panic() check the rest of valid leases.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Wed, 1 Aug 2012 19:06:34 +0000 (21:06 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 19 Aug 2012 14:30:21 +0000 (16:30 +0200)
Taken-from: OpenBSD

sbin/dhclient/dhclient.c

index a5d8d9f..ff7e5b0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: src/sbin/dhclient/dhclient.c,v 1.129 2009/06/06 04:02:42 krw Exp $    */
+/*     $OpenBSD: src/sbin/dhclient/dhclient.c,v 1.130 2009/06/12 20:07:35 stevesk Exp $        */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -197,7 +197,10 @@ routehandler(void)
                if (addr_eq(a, defaddr))
                        break;
 
                if (addr_eq(a, defaddr))
                        break;
 
-               for (l = client->active; l != NULL; l = l->next)
+               /* state_panic() can try unexpired existing leases */
+               if (client->active && addr_eq(a, client->active->address))
+                       break;
+               for (l = client->leases; l != NULL; l = l->next)
                        if (addr_eq(a, l->address))
                                break;
 
                        if (addr_eq(a, l->address))
                                break;
 
@@ -215,6 +218,7 @@ routehandler(void)
                        break;
                if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET)
                        break;
                        break;
                if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET)
                        break;
+               /* XXX check addrs like RTM_NEWADDR instead of this? */
                if (scripttime == 0 || t < scripttime + 10)
                        break;
                errmsg = "interface address deleted";
                if (scripttime == 0 || t < scripttime + 10)
                        break;
                errmsg = "interface address deleted";