summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-11-11 16:36:14 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-11-11 16:36:14 +0000
commitc67ad604f0cdffba977cab84708b96404e19f6d5 (patch)
treed5cef3976346542e86a002a5b1dda2494dc2b57e /sbin/dhclient
parent4ed908179ca3f87bdd917929d4eef798d3d49d25 (diff)
Fix dhclient.conf 'default' directive which was also broken in code
refactoring. i.e. use specified value if server has provided no data.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 63edf266936..d231c112ebf 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.171 2012/11/11 14:33:20 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.172 2012/11/11 16:36:13 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -1936,6 +1936,19 @@ apply_defaults(struct client_lease *lease)
config->defaults[i].len);
break;
+ case ACTION_DEFAULT:
+ if ((newlease->options[i].len == 0) &&
+ (config->defaults[i].len != 0)) {
+ newlease->options[i].len =
+ config->defaults[i].len;
+ newlease->options[i].data = calloc(1,
+ config->defaults[i].len);
+ memcpy(newlease->options[i].data,
+ config->defaults[i].data,
+ config->defaults[i].len);
+ }
+ break;
+
default:
break;
}