summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/dhclient/clparse.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index e5c2d6589e7..994ef45e2e1 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clparse.c,v 1.187 2019/07/19 20:50:22 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.188 2019/07/20 15:39:55 krw Exp $ */
/* Parser for dhclient config and lease files. */
@@ -322,9 +322,6 @@ parse_conf_decl(FILE *cfile, char *name)
if (parse_interface(cfile, name) == 1)
;
break;
- case TOK_LEASE:
- skip_to_semi(cfile);
- break;
case TOK_LINK_TIMEOUT:
if (parse_number(cfile, (unsigned char *)&t, 'L') == 1) {
config->link_timeout = ntohl(t);
@@ -335,29 +332,6 @@ parse_conf_decl(FILE *cfile, char *name)
if (parse_ip_addr(cfile, &config->next_server) == 1)
parse_semi(cfile);
break;
- case TOK_USELEASE:
- memset(list, 0, sizeof(list));
- count = 0;
- if (parse_option_list(cfile, &count, list) == 1) {
- enum actions *p = config->default_actions;
- if (count == 0) {
- for (i = 0; i < DHO_COUNT; i++) {
- free(config->defaults[i].data);
- config->defaults[i].data = NULL;
- config->defaults[i].len = 0;
- p[i] = ACTION_USELEASE;
- }
- } else {
- for (i = 0; i < count; i++) {
- free(config->defaults[list[i]].data);
- config->defaults[list[i]].data = NULL;
- config->defaults[list[i]].len = 0;
- p[list[i]] = ACTION_USELEASE;
- }
- }
- parse_semi(cfile);
- }
- break;
case TOK_PREPEND:
if (parse_option(cfile, &i, config->defaults) == 1) {
action = code_to_action(i, ACTION_PREPEND);
@@ -422,6 +396,29 @@ parse_conf_decl(FILE *cfile, char *name)
parse_semi(cfile);
}
break;
+ case TOK_USELEASE:
+ memset(list, 0, sizeof(list));
+ count = 0;
+ if (parse_option_list(cfile, &count, list) == 1) {
+ enum actions *p = config->default_actions;
+ if (count == 0) {
+ for (i = 0; i < DHO_COUNT; i++) {
+ free(config->defaults[i].data);
+ config->defaults[i].data = NULL;
+ config->defaults[i].len = 0;
+ p[i] = ACTION_USELEASE;
+ }
+ } else {
+ for (i = 0; i < count; i++) {
+ free(config->defaults[list[i]].data);
+ config->defaults[list[i]].data = NULL;
+ config->defaults[list[i]].len = 0;
+ p[list[i]] = ACTION_USELEASE;
+ }
+ }
+ parse_semi(cfile);
+ }
+ break;
default:
parse_warn("expecting statement.");
if (token != ';')