summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2013-08-14 13:52:54 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2013-08-14 13:52:54 +0000
commit9f16a4fc5365d376721f0979bb05443b06612f64 (patch)
treeba3284ea621642177a5d4e4e265a53214b15d07e
parent2908ee3e0a44d8439b10790972149c413dbe46d9 (diff)
Only skip address deleting/adding and route deleting/adding on
identical lease when we are in state S_RENEWING. Otherwise we can end up without an IP address on the interface because dhclient thinks it's still there and doesn't add it. Found the hard way during suspend/resume. OK krw@
-rw-r--r--sbin/dhclient/dhclient.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 631af5c7c7e..7c4fa718144 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.260 2013/07/15 14:03:01 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.261 2013/08/14 13:52:53 florian Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -804,10 +804,10 @@ bind_lease(void)
options = lease->options;
/*
- * A duplicate lease once we are responsible means we don't
+ * A duplicate lease once we are responsible & S_RENEWING means we don't
* need to change the interface, routing table or resolv.conf.
*/
- if ((client->flags & IS_RESPONSIBLE) &&
+ if ((client->flags & IS_RESPONSIBLE) && client->state == S_RENEWING &&
compare_lease(client->active, client->new) == 0) {
client->new->resolv_conf = client->active->resolv_conf;
client->active->resolv_conf = NULL;