From ab511a5cc56acdc5f723411098bb1ead3075d5e0 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 27 Oct 2012 23:08:54 +0000 Subject: 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. --- sbin/dhclient/clparse.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sbin/dhclient/clparse.c') 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]); -- cgit v1.2.3