summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2014-01-25 05:21:24 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2014-01-25 05:21:24 +0000
commit067bb61131912a1493f968b9ce426c2ea150ac1a (patch)
tree9fd4a342618e32bba027d402491e183817d43d80 /sbin/dhclient/dhclient.c
parent780a44540fa2ff9bd783ecedfd9ce76844c59eee (diff)
Correct parsing of dhclient.conf statements 'fixed-address' and
'next-server'. Modify new lease being cloned with their values rather than overwriting original lease being cloned.
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index b725fba9880..3d9fc8490db 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.287 2014/01/21 05:17:45 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.288 2014/01/25 05:21:23 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2179,19 +2179,19 @@ apply_defaults(struct client_lease *lease)
error("Unable to clone lease");
if (config->filename) {
- if (lease->filename)
- free(lease->filename);
- lease->filename = strdup(config->filename);
+ if (newlease->filename)
+ free(newlease->filename);
+ newlease->filename = strdup(config->filename);
}
if (config->server_name) {
- if (lease->server_name)
- free(lease->server_name);
- lease->server_name = strdup(config->server_name);
+ if (newlease->server_name)
+ free(newlease->server_name);
+ newlease->server_name = strdup(config->server_name);
}
if (config->address.s_addr != INADDR_ANY)
- lease->address.s_addr = config->address.s_addr;
+ newlease->address.s_addr = config->address.s_addr;
if (config->next_server.s_addr != INADDR_ANY)
- lease->next_server.s_addr = config->next_server.s_addr;
+ newlease->next_server.s_addr = config->next_server.s_addr;
for (i = 0; i < 256; i++) {
for (j = 0; j < config->ignored_option_count; j++) {