-/* $OpenBSD: clparse.c,v 1.167 2018/02/06 00:25:09 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.168 2018/02/10 23:25:15 krw Exp $ */
/* Parser for dhclient config and lease files. */
parse_semi(cfile);
break;
case TOK_IGNORE:
+ memset(list, 0, sizeof(list));
+ count = 0;
if (parse_option_list(cfile, &count, list) == 1) {
- for (i = 0; i < count; i++)
- config->default_actions[list[i]] = ACTION_IGNORE;
+ enum actions *p = config->default_actions;
+ if (count == 0) {
+ for (i = 0; i < DHO_COUNT; i++)
+ if (p[i] == ACTION_IGNORE)
+ p[i] = ACTION_NONE;
+ } else {
+ for (i = 0; i < count; i++)
+ p[list[i]] = ACTION_IGNORE;
+ }
parse_semi(cfile);
}
break;
return 1;
}
- memset(list, DHO_PAD, sizeof(list));
- ix = 0;
+ memset(list, 0, sizeof(list));
+ memcpy(list, optlist, *count);
+ ix = *count;
do {
/* Next token must be an option name. */
token = next_token(&val, cfile);
-.\" $OpenBSD: dhclient.conf.5,v 1.40 2018/02/06 00:25:09 krw Exp $
+.\" $OpenBSD: dhclient.conf.5,v 1.41 2018/02/10 23:25:15 krw Exp $
.\"
.\" Copyright (c) 1997 The Internet Software Consortium.
.\" All rights reserved.
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
.\"
-.Dd $Mdocdate: February 6 2018 $
+.Dd $Mdocdate: February 10 2018 $
.Dt DHCLIENT.CONF 5
.Os
.Sh NAME
.Ar option .
.It Ic ignore Op Ar option , ... ;
Discard values provided for the listed options.
-Each
.Ic ignore
-overrides any previous one.
+statements are cumulative, except that an empty
+list will remove all previously specified options.
.It Ic prepend Ar option option-value ;
Prepend
.Ar option-value
.It Ic request Op Ar option , ... ;
Ask that any lease contain values
for the listed options.
-Each
.Ic request
-overrides any previous one.
+statements are cumulative, except that an empty
+list will remove all previously specified options.
The default is to request the options
bootfile-name
broadcast-address,
is present all leases from any of the
addresses will be discarded.
.It Ic require Op Ar option , ... ;
-Discard leases that do not contain all the listed options.
-Each
+Discard leases that do not contain the listed options.
.Ic require
-overrides any previous one.
+statements are cumulative, except that an empty
+list will remove all previously specified options.
.El
.Sh SEE ALSO
.Xr dhclient.leases 5 ,
-/* $OpenBSD: dhcpd.h,v 1.252 2018/02/07 01:03:10 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.253 2018/02/10 23:25:15 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
S_RENEWING
};
+enum actions {
+ ACTION_NONE,
+ ACTION_DEFAULT,
+ ACTION_SUPERSEDE,
+ ACTION_PREPEND,
+ ACTION_APPEND,
+ ACTION_IGNORE
+};
+
TAILQ_HEAD(client_lease_tq, client_lease);
struct client_config {
- struct option_data defaults[DHO_COUNT];
- enum {
- ACTION_DEFAULT,
- ACTION_SUPERSEDE,
- ACTION_PREPEND,
- ACTION_APPEND,
- ACTION_IGNORE
- } default_actions[DHO_COUNT];
-
+ struct option_data defaults[DHO_COUNT];
+ enum actions default_actions[DHO_COUNT];
struct in_addr address;
struct in_addr next_server;
struct option_data send_options[DHO_COUNT];