summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2009-06-12 20:07:36 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2009-06-12 20:07:36 +0000
commitea6bd7b6f8339dac1de544c76eab804cb8594a67 (patch)
treeeec09f1901d32d1da4e3cc8df319a0eb54b9609a /sbin
parent0888dbb8c8f1691a223dd7811fe181cc56694f3f (diff)
state_panic() tries the active then other valid leases by setting the
interface to each address and trying to ping the gateway. This will trigger an RTM_NEWADDR message. routehandler() only checks for the active and alias address in RTM_NEWADDR messages, so we can exit when state_panic() and the message address is on client->leases. routehandler() needs to also check client->leases. testing krw, 'I say commit' krw
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 9c96272943d..6cbe8e80679 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.129 2009/06/06 04:02:42 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.130 2009/06/12 20:07:35 stevesk Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -196,10 +196,12 @@ routehandler(void)
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 (l != NULL || (client->alias &&
addr_eq(a, client->alias->address)))
/* new addr is the one we set */
@@ -216,6 +218,7 @@ routehandler(void)
if (findproto((char *)ifam + ifam->ifam_hdrlen,
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";