netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next] netfilter: nf_tables: fix a wrong check to skip the inactive rules
@ 2016-06-14 12:13 Liping Zhang
  2016-06-15  9:42 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Liping Zhang @ 2016-06-14 12:13 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, Liping Zhang, Patrick McHardy

From: Liping Zhang <liping.zhang@spreadtrum.com>

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 <kaber@trash.net>
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
---
 net/netfilter/nf_tables_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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++;
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nf-next] netfilter: nf_tables: fix a wrong check to skip the inactive rules
  2016-06-14 12:13 [PATCH nf-next] netfilter: nf_tables: fix a wrong check to skip the inactive rules Liping Zhang
@ 2016-06-15  9:42 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-06-15  9:42 UTC (permalink / raw)
  To: Liping Zhang; +Cc: netfilter-devel, Liping Zhang, Patrick McHardy

On Tue, Jun 14, 2016 at 08:13:04PM +0800, Liping Zhang wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
> 
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-15  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-14 12:13 [PATCH nf-next] netfilter: nf_tables: fix a wrong check to skip the inactive rules Liping Zhang
2016-06-15  9:42 ` Pablo Neira Ayuso

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