Skip to contentSkip to conversation

netfilter: nf_tables: fix a wrong check to skip the inactive rules

PATCH Applied Liping Zhang 2 participants 2 messages Jun 14, 2016 – Jun 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nf_tables: fix a wrong check to skip the inactive rules

From: Liping Zhang <[email protected]>

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 <[email protected]>
---
 net/netfilter/nf_tables_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_core.c +1 -1
index e9f8dff..fb8b589 100644
@@ -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++;
Signature · 1 line
2.5.5
maintainer Applied
#1 lore raw
Quoted 6 lines · Liping Zhang

From: Liping Zhang <[email protected]>

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")

Applied, thanks.