netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf 1/5] netfilter: nf_tables: reset rule number counter after jump and goto
@ 2014-05-12 14:40 Pablo Neira Ayuso
  2014-05-12 14:40 ` [PATCH nf 2/5] netfilter: nf_tables: fix goto action Pablo Neira Ayuso
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2014-05-12 14:40 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber

Otherwise we start incrementing the rule number counter from the
previous chain iteration.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c
index 8041053..4368c58 100644
--- a/net/netfilter/nf_tables_core.c
+++ b/net/netfilter/nf_tables_core.c
@@ -123,7 +123,7 @@ nft_do_chain(struct nft_pktinfo *pkt, const struct nf_hook_ops *ops)
 	struct nft_data data[NFT_REG_MAX + 1];
 	unsigned int stackptr = 0;
 	struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE];
-	int rulenum = 0;
+	int rulenum;
 	/*
 	 * Cache cursor to avoid problems in case that the cursor is updated
 	 * while traversing the ruleset.
@@ -131,6 +131,7 @@ nft_do_chain(struct nft_pktinfo *pkt, const struct nf_hook_ops *ops)
 	unsigned int gencursor = ACCESS_ONCE(chain->net->nft.gencursor);
 
 do_chain:
+	rulenum = 0;
 	rule = list_entry(&chain->rules, struct nft_rule, list);
 next_rule:
 	data[NFT_REG_VERDICT].verdict = NFT_CONTINUE;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-12 14:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-12 14:40 [PATCH nf 1/5] netfilter: nf_tables: reset rule number counter after jump and goto Pablo Neira Ayuso
2014-05-12 14:40 ` [PATCH nf 2/5] netfilter: nf_tables: fix goto action Pablo Neira Ayuso
2014-05-12 14:40 ` [PATCH nf 3/5] netfilter: nf_tables: fix tracing of the " Pablo Neira Ayuso
2014-05-12 14:40 ` [PATCH nf 4/5] netfilter: nf_tables: fix bogus rulenum after " Pablo Neira Ayuso
2014-05-12 14:40 ` [PATCH nf 5/5] netfilter: nf_tables: fix missing return trace at the end of non-base chain Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).