dhclient: skip_to_semi() consumes semicolon already

When invalid statement is found the next statement is skipped even if it
is valid.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31527
This commit is contained in:
Franco Fichtner 2021-08-19 09:11:38 -04:00 committed by Mark Johnston
parent 5851803f4b
commit a313b5240a

View File

@ -199,7 +199,6 @@ void
parse_client_statement(FILE *cfile, struct interface_info *ip,
struct client_config *config)
{
int token;
char *val;
struct option *option;
time_t tmp;
@ -290,15 +289,11 @@ parse_client_statement(FILE *cfile, struct interface_info *ip,
parse_reject_statement(cfile, config);
return;
default:
parse_warn("expecting a statement.");
skip_to_semi(cfile);
break;
}
token = next_token(&val, cfile);
if (token != SEMI) {
parse_warn("semicolon expected.");
skip_to_semi(cfile);
}
parse_warn("expecting a statement.");
skip_to_semi(cfile);
}
unsigned
@ -637,7 +632,7 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease,
if (token != STRING) {
parse_warn("expecting interface name (in quotes).");
skip_to_semi(cfile);
break;
return;
}
ip = interface_or_dummy(val);
*ipp = ip;
@ -674,7 +669,7 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease,
default:
parse_warn("expecting lease declaration.");
skip_to_semi(cfile);
break;
return;
}
token = next_token(&val, cfile);
if (token != SEMI) {