From owner-svn-src-stable@freebsd.org Fri Mar 10 05:44:16 2017 Return-Path: Delivered-To: svn-src-stable@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 183D9D05429; Fri, 10 Mar 2017 05:44:16 +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 B24911B8F; Fri, 10 Mar 2017 05:44:15 +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 v2A5iEdf070486; Fri, 10 Mar 2017 05:44:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2A5iEWA070485; Fri, 10 Mar 2017 05:44:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201703100544.v2A5iEWA070485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 10 Mar 2017 05:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314990 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2017 05:44:16 -0000 Author: ae Date: Fri Mar 10 05:44:14 2017 New Revision: 314990 URL: https://svnweb.freebsd.org/changeset/base/314990 Log: MFC r314614: Fix matching table entry value. Use real table value instead of its index in valuestate array. When opcode has size equal to ipfw_insn_u32, this means that it should additionally match value specified in d[0] with table entry value. ipfw_table_lookup() returns table value index, use TARG_VAL() macro to convert it to its value. The actual 32-bit value stored in the tag field of table_value structure, where all unspecified u32 values are kept. PR: 217262 Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Fri Mar 10 04:49:40 2017 (r314989) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Fri Mar 10 05:44:14 2017 (r314990) @@ -1510,8 +1510,8 @@ do { \ if (!match) break; if (cmdlen == F_INSN_SIZE(ipfw_insn_u32)) - match = - ((ipfw_insn_u32 *)cmd)->d[0] == v; + match = ((ipfw_insn_u32 *)cmd)->d[0] == + TARG_VAL(chain, v, tag); else tablearg = v; } else if (is_ipv6) { @@ -1523,7 +1523,8 @@ do { \ sizeof(struct in6_addr), pkey, &v); if (cmdlen == F_INSN_SIZE(ipfw_insn_u32)) - match = ((ipfw_insn_u32 *)cmd)->d[0] == v; + match = ((ipfw_insn_u32 *)cmd)->d[0] == + TARG_VAL(chain, v, tag); if (match) tablearg = v; } @@ -1535,7 +1536,8 @@ do { \ match = ipfw_lookup_table_extended(chain, cmd->arg1, 0, &args->f_id, &v); if (cmdlen == F_INSN_SIZE(ipfw_insn_u32)) - match = ((ipfw_insn_u32 *)cmd)->d[0] == v; + match = ((ipfw_insn_u32 *)cmd)->d[0] == + TARG_VAL(chain, v, tag); if (match) tablearg = v; }