svn commit: r200852 - user/luigi/ipfw3-head/sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Tue Dec 22 17:44:57 UTC 2009


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;


More information about the svn-src-user mailing list