From owner-svn-src-all@freebsd.org Sun Aug 14 18:05:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E064CBBAF0E; Sun, 14 Aug 2016 18:05:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09A81640; Sun, 14 Aug 2016 18:05:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EI5fVO024737; Sun, 14 Aug 2016 18:05:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EI5fmu024736; Sun, 14 Aug 2016 18:05:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141805.u7EI5fmu024736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 18:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304087 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2016 18:05:43 -0000 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);