aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-05-10 07:39:21 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2014-05-10 13:12:04 -0400
commitd088be8042841f024156ee68fecfef7503d660cb (patch)
tree123872c07a4f5c762aae400c236085103e904f66
parenta8951d5814e1373807a94f79f7ccec7041325470 (diff)
netfilter: nf_tables: reset rule number counter after jump and goto
Otherwise we start incrementing the rule number counter from the previous chain iteration. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/netfilter/nf_tables_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c
index 804105391b9a..4368c5850548 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)
123 struct nft_data data[NFT_REG_MAX + 1]; 123 struct nft_data data[NFT_REG_MAX + 1];
124 unsigned int stackptr = 0; 124 unsigned int stackptr = 0;
125 struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE]; 125 struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE];
126 int rulenum = 0; 126 int rulenum;
127 /* 127 /*
128 * Cache cursor to avoid problems in case that the cursor is updated 128 * Cache cursor to avoid problems in case that the cursor is updated
129 * while traversing the ruleset. 129 * while traversing the ruleset.
@@ -131,6 +131,7 @@ nft_do_chain(struct nft_pktinfo *pkt, const struct nf_hook_ops *ops)
131 unsigned int gencursor = ACCESS_ONCE(chain->net->nft.gencursor); 131 unsigned int gencursor = ACCESS_ONCE(chain->net->nft.gencursor);
132 132
133do_chain: 133do_chain:
134 rulenum = 0;
134 rule = list_entry(&chain->rules, struct nft_rule, list); 135 rule = list_entry(&chain->rules, struct nft_rule, list);
135next_rule: 136next_rule:
136 data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; 137 data[NFT_REG_VERDICT].verdict = NFT_CONTINUE;