From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: wenxu@ucloud.cn
Subject: [PATCH nf-next 2/2] netfilter: nf_tables_offload: save one indent level in nft_indr_block_cb()
Date: Mon, 2 Sep 2019 23:11:32 +0200 [thread overview]
Message-ID: <20190902211132.32200-2-pablo@netfilter.org> (raw)
In-Reply-To: <20190902211132.32200-1-pablo@netfilter.org>
Save one indent level in the nft_indr_block_cb() loop.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_tables_offload.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
index 1e69bd7f9fe1..b2f169be2a37 100644
--- a/net/netfilter/nf_tables_offload.c
+++ b/net/netfilter/nf_tables_offload.c
@@ -354,8 +354,9 @@ int nft_flow_rule_offload_commit(struct net *net)
static void nft_indr_block_cb(struct net_device *dev,
flow_indr_block_bind_cb_t *cb, void *cb_priv,
- enum flow_block_command command)
+ enum flow_block_command cmd)
{
+ struct nft_base_chain *basechain;
struct net *net = dev_net(dev);
const struct nft_table *table;
const struct nft_chain *chain;
@@ -365,18 +366,15 @@ static void nft_indr_block_cb(struct net_device *dev,
continue;
list_for_each_entry_rcu(chain, &table->chains, list) {
- if (nft_is_base_chain(chain)) {
- struct nft_base_chain *basechain;
-
- basechain = nft_base_chain(chain);
- if (!strncmp(basechain->dev_name, dev->name,
- IFNAMSIZ)) {
- nft_indr_block_ing_cmd(dev, basechain,
- cb, cb_priv,
- command);
- return;
- }
- }
+ if (!nft_is_base_chain(chain))
+ continue;
+
+ basechain = nft_base_chain(chain);
+ if (strncmp(basechain->dev_name, dev->name, IFNAMSIZ))
+ continue;
+
+ nft_indr_block_ing_cmd(dev, basechain, cb, cb_priv, cmd);
+ return;
}
}
}
--
2.11.0
next prev parent reply other threads:[~2019-09-02 21:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 21:11 [PATCH nf-next 1/2] netfilter: nf_tables_offload: move indirect flow_block callback logic to core Pablo Neira Ayuso
2019-09-02 21:11 ` Pablo Neira Ayuso [this message]
2019-09-08 16:23 ` Pablo Neira Ayuso
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=20190902211132.32200-2-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=wenxu@ucloud.cn \
/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).