From 9f16a4fc5365d376721f0979bb05443b06612f64 Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Wed, 14 Aug 2013 13:52:54 +0000 Subject: 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@ --- sbin/dhclient/dhclient.c | 6 +++--- 1 file 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 @@ -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; -- cgit v1.2.3