netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 5/7] netfilter: nf_tables: fix a wrong check to skip the inactive rules
Date: Fri, 17 Jun 2016 20:25:17 +0200	[thread overview]
Message-ID: <1466187919-12800-6-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1466187919-12800-1-git-send-email-pablo@netfilter.org>

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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 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.1.4

  parent reply	other threads:[~2016-06-17 18:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 18:25 [PATCH 0/7] Netfilter fixes for net Pablo Neira Ayuso
2016-06-17 18:25 ` [PATCH 1/7] netfilter: conntrack: destroy kmemcache on module removal Pablo Neira Ayuso
2016-06-17 18:25 ` [PATCH 2/7] netfilter: nf_tables: fix wrong check of NFT_SET_MAP in nf_tables_bind_set Pablo Neira Ayuso
2016-06-17 18:25 ` [PATCH 3/7] netfilter: nf_tables: reject loops from set element jump to chain Pablo Neira Ayuso
2016-06-17 18:25 ` [PATCH 4/7] netfilter: nf_tables: fix wrong destroy anonymous sets if binding fails Pablo Neira Ayuso
2016-06-17 18:25 ` Pablo Neira Ayuso [this message]
2016-06-17 18:25 ` [PATCH 6/7] netfilter: xt_SYNPROXY: add missing header to Kbuild Pablo Neira Ayuso
2016-06-17 18:25 ` [PATCH 7/7] netfilter: xt_SYNPROXY: include missing <linux/types.h> Pablo Neira Ayuso
2016-06-18  2:50 ` [PATCH 0/7] Netfilter fixes for net David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466187919-12800-6-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).