From: Liping Zhang Date: Tue, 14 Jun 2016 12:13:04 +0000 (+0800) Subject: netfilter: nf_tables: fix a wrong check to skip the inactive rules X-Git-Tag: v5.15~13344^2~46^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8fff1722f705ce5023a0d6d77a31a9d013be2a34;p=platform%2Fkernel%2Flinux-starfive.git netfilter: nf_tables: fix a wrong check to skip the inactive rules 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: ea4bd995b0f2 ("netfilter: nf_tables: add transaction helper functions") Cc: Patrick McHardy Signed-off-by: Liping Zhang Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c index e9f8dff..fb8b589 100644 --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c @@ -143,7 +143,7 @@ next_rule: 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++;