Date: Sun, 14 Aug 2016 18:05:41 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304087 - head/sbin/ipfw Message-ID: <201608141805.u7EI5fmu024736@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Sun Aug 14 18:05:41 2016 New Revision: 304087 URL: https://svnweb.freebsd.org/changeset/base/304087 Log: Do not warn about ambiguous state name when we inspect a comment token. Reported by: lev Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Aug 14 16:57:10 2016 (r304086) +++ head/sbin/ipfw/ipfw2.c Sun Aug 14 18:05:41 2016 (r304087) @@ -3718,11 +3718,14 @@ compile_rule(char *av[], uint32_t *rbuf, } if (strcmp(*av, "any") == 0) action->arg1 = 0; - else if (match_token(rule_options, *av) != -1) { + else if ((i = match_token(rule_options, *av)) != -1) { action->arg1 = pack_object(tstate, default_state_name, IPFW_TLV_STATE_NAME); - warn("Ambiguous state name '%s', '%s' used instead.\n", - *av, default_state_name); + if (i != TOK_COMMENT) + warn("Ambiguous state name '%s', '%s'" + " used instead.\n", *av, + default_state_name); + break; } else if (state_check_name(*av) == 0) action->arg1 = pack_object(tstate, *av, IPFW_TLV_STATE_NAME); @@ -4563,8 +4566,8 @@ read_options: errx(EX_USAGE, "only one of keep-state " "and limit is allowed"); if (*av == NULL || - match_token(rule_options, *av) != -1) { - if (*av != NULL) + (i = match_token(rule_options, *av)) != -1) { + if (*av != NULL && i != TOK_COMMENT) warn("Ambiguous state name '%s'," " '%s' used instead.\n", *av, default_state_name); @@ -4615,8 +4618,8 @@ read_options: av++; if (*av == NULL || - match_token(rule_options, *av) != -1) { - if (*av != NULL) + (i = match_token(rule_options, *av)) != -1) { + if (*av != NULL && i != TOK_COMMENT) warn("Ambiguous state name '%s'," " '%s' used instead.\n", *av, default_state_name);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608141805.u7EI5fmu024736>