summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevesk <stevesk@openbsd.org>2009-06-12 20:07:35 +0000
committerstevesk <stevesk@openbsd.org>2009-06-12 20:07:35 +0000
commit7c0b1ba33821ac43af880cb79928c8b916849e3b (patch)
tree197b7d99324371ae18bed023a730475080174075
parentMake sure splsoftnet() masks softclock; fallout form switch to generic (diff)
downloadwireguard-openbsd-7c0b1ba33821ac43af880cb79928c8b916849e3b.tar.xz
wireguard-openbsd-7c0b1ba33821ac43af880cb79928c8b916849e3b.zip
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
-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";