Skip to content

Commit

Permalink
netfilter: nf_tables: fix a wrong check to skip the inactive rules
Browse files Browse the repository at this point in the history
nft_genmask_cur has already done left-shift operator on the gencursor,
so there's no need to do left-shift operator on it again.

Fixes: ea4bd99 ("netfilter: nf_tables: add transaction helper functions")
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Liping Zhang authored and Pablo Neira Ayuso committed Jun 15, 2016
1 parent a02f424 commit 8fff172
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
list_for_each_entry_continue_rcu(rule, &chain->rules, list) {

/* This rule is not active, skip. */
if (unlikely(rule->genmask & (1 << gencursor)))
if (unlikely(rule->genmask & gencursor))
continue;

rulenum++;
Expand Down

0 comments on commit 8fff172

Please sign in to comment.