From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 1/6] netfilter: nf_tables: reset rule number counter after jump and goto
Date: Tue, 20 May 2014 11:45:21 +0200 [thread overview]
Message-ID: <1400579126-6451-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1400579126-6451-1-git-send-email-pablo@netfilter.org>
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
next prev parent reply other threads:[~2014-05-20 9:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 9:45 [PATCH 0/6] Netfilter/nftables fixes for net Pablo Neira Ayuso
2014-05-20 9:45 ` Pablo Neira Ayuso [this message]
2014-05-20 9:45 ` [PATCH 2/6] netfilter: nf_tables: fix goto action Pablo Neira Ayuso
2014-05-20 9:45 ` [PATCH 3/6] netfilter: nf_tables: fix tracing of the " Pablo Neira Ayuso
2014-05-20 9:45 ` [PATCH 4/6] netfilter: nf_tables: fix bogus rulenum after " Pablo Neira Ayuso
2014-05-20 9:45 ` [PATCH 5/6] netfilter: nf_tables: fix missing return trace at the end of non-base chain Pablo Neira Ayuso
2014-05-20 9:45 ` [PATCH 6/6] netfilter: nf_tables: fix trace of matching non-terminal rule Pablo Neira Ayuso
2014-05-21 5:25 ` [PATCH 0/6] Netfilter/nftables fixes for net David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400579126-6451-2-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).