The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a313b5240a477e0d04294ffd170408d954181daa

commit a313b5240a477e0d04294ffd170408d954181daa
Author:     Franco Fichtner <[email protected]>
AuthorDate: 2021-08-19 13:11:38 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2021-08-19 13:11:38 +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
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D31527
---
 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) {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "[email protected]"

Reply via email to