summaryrefslogtreecommitdiff
path: root/sbin/dhclient/clparse.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-10-27 23:08:54 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-10-27 23:08:54 +0000
commitab511a5cc56acdc5f723411098bb1ead3075d5e0 (patch)
treef2b7a926be0d01090db6ecefa3a25802daf72897 /sbin/dhclient/clparse.c
parenta4f754ad67aa4517d148b7f5a0a2a60e6ec6243e (diff)
Change dhclient.conf directive 'ignore' to take a list of option names
rather than list of option declarations. e.g. 'ignore routers;' instead of 'ignore routers 1.2.3.4;' The value in the declaration was being ignored anyway. While there clean up the related code a bit.
Diffstat (limited to 'sbin/dhclient/clparse.c')
-rw-r--r--sbin/dhclient/clparse.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index 9119943c496..877c4330008 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clparse.c,v 1.40 2012/08/26 23:33:29 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.41 2012/10/27 23:08:53 krw Exp $ */
/* Parser for dhclient config and lease files... */
@@ -154,7 +154,8 @@ read_client_leases(void)
void
parse_client_statement(FILE *cfile)
{
- int token, code;
+ u_int8_t ignorelist[256];
+ int token, code, count, i;
switch (next_token(NULL, cfile)) {
case TOK_SEND:
@@ -171,9 +172,9 @@ parse_client_statement(FILE *cfile)
config->default_actions[code] = ACTION_SUPERSEDE;
return;
case TOK_IGNORE:
- code = parse_option_decl(cfile, &config->defaults[0]);
- if (code != -1)
- config->default_actions[code] = ACTION_IGNORE;
+ count = parse_option_list(cfile, ignorelist);
+ for (i = 0; i < count; i++)
+ config->default_actions[ignorelist[i]] = ACTION_IGNORE;
return;
case TOK_APPEND:
code = parse_option_decl(cfile, &config->defaults[0]);