From owner-svn-src-user@FreeBSD.ORG Tue Dec 22 17:44:57 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228761065679; Tue, 22 Dec 2009 17:44:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11EAA8FC12; Tue, 22 Dec 2009 17:44:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMHiuls071032; Tue, 22 Dec 2009 17:44:56 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMHiuWp071030; Tue, 22 Dec 2009 17:44:56 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912221744.nBMHiuWp071030@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 22 Dec 2009 17:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200852 - user/luigi/ipfw3-head/sys/netinet/ipfw X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 17:44:57 -0000 Author: luigi Date: Tue Dec 22 17:44:56 2009 New Revision: 200852 URL: http://svn.freebsd.org/changeset/base/200852 Log: simplify set_match Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw2.c Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw2.c Tue Dec 22 17:02:57 2009 (r200851) +++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw2.c Tue Dec 22 17:44:56 2009 (r200852) @@ -717,12 +717,12 @@ check_uidgid(ipfw_insn_u32 *insn, int pr */ static inline void set_match(struct ip_fw_args *args, int slot, - struct ip_fw *f, struct ip_fw_chain *chain) + struct ip_fw_chain *chain) { args->chain_id = chain->id; args->slot = slot + 1; /* we use 0 as a marker */ - args->rule_id = f->id; - args->rulenum = f->rulenum; + args->rule_id = chain->map[slot]->id; + args->rulenum = chain->map[slot]->rulenum; } /* @@ -1922,7 +1922,7 @@ do { \ case O_PIPE: case O_QUEUE: - set_match(args, f_pos, f, chain); + set_match(args, f_pos, chain); args->cookie = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg : cmd->arg1; if (cmd->opcode == O_QUEUE) @@ -2070,7 +2070,7 @@ do { \ case O_NETGRAPH: case O_NGTEE: - set_match(args, f_pos, f, chain); + set_match(args, f_pos, chain); args->cookie = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg : cmd->arg1; retval = (cmd->opcode == O_NETGRAPH) ? @@ -2095,7 +2095,7 @@ do { \ struct cfg_nat *t; int nat_id; - set_match(args, f_pos, f, chain); + set_match(args, f_pos, chain); t = ((ipfw_insn_nat *)cmd)->nat; if (t == NULL) { nat_id = (cmd->arg1 == IP_FW_TABLEARG) ? @@ -2162,7 +2162,7 @@ do { \ else ip->ip_sum = in_cksum(m, hlen); retval = IP_FW_REASS; - set_match(args, f_pos, f, chain); + set_match(args, f_pos, chain); } done = 1; /* exit outer loop */ break;