From owner-dev-commits-src-all@freebsd.org Thu Aug 26 11:46:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45F2C668309; Thu, 26 Aug 2021 11:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GwLfP0lmvz3GgF; Thu, 26 Aug 2021 11:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3DE976E3; Thu, 26 Aug 2021 11:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17QBkaZG053850; Thu, 26 Aug 2021 11:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17QBkaHA053849; Thu, 26 Aug 2021 11:46:36 GMT (envelope-from git) Date: Thu, 26 Aug 2021 11:46:36 GMT Message-Id: <202108261146.17QBkaHA053849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3bcf919c4e89 - stable/13 - dhclient: skip_to_semi() consumes semicolon already MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3bcf919c4e891287038150116ee81054a46b0075 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 11:46:37 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3bcf919c4e891287038150116ee81054a46b0075 commit 3bcf919c4e891287038150116ee81054a46b0075 Author: Franco Fichtner AuthorDate: 2021-08-19 13:11:38 +0000 Commit: Mark Johnston CommitDate: 2021-08-26 11:46:01 +0000 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 (cherry picked from commit a313b5240a477e0d04294ffd170408d954181daa) --- sbin/dhclient/clparse.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 58ece525f8d1..c7b02a073aa3 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -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) {