diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-07-15 22:33:05 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-07-15 22:33:05 +0000 |
commit | abff5466b02411ed87953663a0b8e6e7bf395869 (patch) | |
tree | 459bcdc431abbd5aed683f7f34182527b9084673 /sbin | |
parent | bd54272c4f8d4d8f7eeca6c1ac9af34c181d595d (diff) |
Fix handling of comma separated option value lists, broken in r1.20.
Found and fix tested by Moritz Jodeit.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/clparse.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 6ada6307992..30c990f991d 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.22 2005/07/11 18:24:08 deraadt Exp $ */ +/* $OpenBSD: clparse.c,v 1.23 2005/07/15 22:33:04 krw Exp $ */ /* Parser for dhclient config and lease files... */ @@ -684,12 +684,10 @@ parse_option_decl(FILE *cfile, struct option_data *options) /* Look up the actual option info. */ fmt = NULL; for (code=0; code < 256; code++) - if (strcmp(dhcp_options[code].name, val) == 0) { - fmt = dhcp_options[code].format; + if (strcmp(dhcp_options[code].name, val) == 0) break; - } - if (!fmt) { + if (code > 255) { parse_warn("no option named %s", val); skip_to_semi(cfile); return (NULL); @@ -697,7 +695,7 @@ parse_option_decl(FILE *cfile, struct option_data *options) /* Parse the option data... */ do { - for (; *fmt; fmt++) { + for (fmt = dhcp_options[code].format; *fmt; fmt++) { if (*fmt == 'A') break; switch (*fmt) { |