From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org
Subject: [PATCH net-next 07/19] netfilter: nft_meta: extend reduce support to bridge family
Date: Mon, 21 Mar 2022 13:30:40 +0100 [thread overview]
Message-ID: <20220321123052.70553-8-pablo@netfilter.org> (raw)
In-Reply-To: <20220321123052.70553-1-pablo@netfilter.org>
From: Florian Westphal <fw@strlen.de>
its enough to export the meta get reduce helper and then call it
from nft_meta_bridge too.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/net/netfilter/nft_meta.h | 2 ++
net/bridge/netfilter/nft_meta_bridge.c | 1 +
net/netfilter/nft_meta.c | 5 +++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/net/netfilter/nft_meta.h b/include/net/netfilter/nft_meta.h
index 246fd023dcf4..9b51cc67de54 100644
--- a/include/net/netfilter/nft_meta.h
+++ b/include/net/netfilter/nft_meta.h
@@ -44,4 +44,6 @@ int nft_meta_set_validate(const struct nft_ctx *ctx,
const struct nft_expr *expr,
const struct nft_data **data);
+bool nft_meta_get_reduce(struct nft_regs_track *track,
+ const struct nft_expr *expr);
#endif
diff --git a/net/bridge/netfilter/nft_meta_bridge.c b/net/bridge/netfilter/nft_meta_bridge.c
index 380a31ebf840..8c3eaba87ad2 100644
--- a/net/bridge/netfilter/nft_meta_bridge.c
+++ b/net/bridge/netfilter/nft_meta_bridge.c
@@ -99,6 +99,7 @@ static const struct nft_expr_ops nft_meta_bridge_get_ops = {
.eval = nft_meta_bridge_get_eval,
.init = nft_meta_bridge_get_init,
.dump = nft_meta_get_dump,
+ .reduce = nft_meta_get_reduce,
};
static bool nft_meta_bridge_set_reduce(struct nft_regs_track *track,
diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c
index 482eed7c7bbf..ac4859241e17 100644
--- a/net/netfilter/nft_meta.c
+++ b/net/netfilter/nft_meta.c
@@ -752,8 +752,8 @@ static int nft_meta_get_offload(struct nft_offload_ctx *ctx,
return 0;
}
-static bool nft_meta_get_reduce(struct nft_regs_track *track,
- const struct nft_expr *expr)
+bool nft_meta_get_reduce(struct nft_regs_track *track,
+ const struct nft_expr *expr)
{
const struct nft_meta *priv = nft_expr_priv(expr);
const struct nft_meta *meta;
@@ -775,6 +775,7 @@ static bool nft_meta_get_reduce(struct nft_regs_track *track,
return nft_expr_reduce_bitwise(track, expr);
}
+EXPORT_SYMBOL_GPL(nft_meta_get_reduce);
static const struct nft_expr_ops nft_meta_get_ops = {
.type = &nft_meta_type,
--
2.30.2
next prev parent reply other threads:[~2022-03-21 12:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 12:30 [PATCH net-next 00/19] Netfilter updates for net-next Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 01/19] netfilter: conntrack: revisit gc autotuning Pablo Neira Ayuso
2022-03-21 13:20 ` patchwork-bot+netdevbpf
2022-03-21 12:30 ` [PATCH net-next 02/19] netfilter: conntrack: Add and use nf_ct_set_auto_assign_helper_warned() Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 03/19] netfilter: nf_tables: do not reduce read-only expressions Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 04/19] netfilter: nf_tables: cancel tracking for clobbered destination registers Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 05/19] netfilter: nft_ct: track register operations Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 06/19] netfilter: nft_lookup: only cancel tracking for clobbered dregs Pablo Neira Ayuso
2022-03-21 12:30 ` Pablo Neira Ayuso [this message]
2022-03-21 12:30 ` [PATCH net-next 08/19] netfilter: nft_numgen: cancel register tracking Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 09/19] netfilter: nft_osf: track register operations Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 10/19] netfilter: nft_hash: " Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 11/19] netfilter: nft_immediate: cancel register tracking for data destination register Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 12/19] netfilter: nft_socket: track register operations Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 13/19] netfilter: nft_xfrm: " Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 14/19] netfilter: nft_tunnel: " Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 15/19] netfilter: nft_fib: add reduce support Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 16/19] netfilter: nft_exthdr: " Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 17/19] netfilter: nf_nat_h323: eliminate anonymous module_init & module_exit Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 18/19] netfilter: flowtable: remove redundant field in flow_offload_work struct Pablo Neira Ayuso
2022-03-21 12:30 ` [PATCH net-next 19/19] netfilter: flowtable: pass flowtable to nf_flow_table_iterate() 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=20220321123052.70553-8-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--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).