summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2014-07-11 20:41:42 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2014-07-11 20:41:42 +0000
commitc54bcb8175b8f53424b7607c863d1d4ac764e567 (patch)
tree97b1c81424916dd19b6e730b697a9279e9b36744 /sbin/dhclient
parent96c08a7b2a86e43ab29d4a9369f6fcb8817dc25b (diff)
Move updating resolv.conf contents and active lease to before address
manipulation starts. Thus making it more likely the correct resolv.conf gets written.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 89a08a98d21..287006b5829 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.313 2014/07/11 20:19:30 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.314 2014/07/11 20:41:41 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -843,6 +843,13 @@ bind_lease(void)
goto newlease;
}
+ client->new->resolv_conf = resolv_conf_contents(
+ &options[DHO_DOMAIN_NAME], &options[DHO_DOMAIN_NAME_SERVERS]);
+
+ /* Replace the old active lease with the new one. */
+ client->active = client->new;
+ client->new = NULL;
+
/* Deleting the addresses also clears out arp entries. */
delete_addresses(ifi->name, ifi->rdomain);
flush_routes(ifi->name, ifi->rdomain);
@@ -892,13 +899,7 @@ bind_lease(void)
&options[DHO_STATIC_ROUTES]);
}
- client->new->resolv_conf = resolv_conf_contents(
- &options[DHO_DOMAIN_NAME], &options[DHO_DOMAIN_NAME_SERVERS]);
-
newlease:
- /* Replace the old active lease with the new one. */
- client->active = client->new;
- client->new = NULL;
rewrite_option_db(client->active, lease);
free_client_lease(lease);