summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-05-13 23:29:55 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2021-05-28 22:11:41 +0300
commit0974cff3eb66764cc86b60f1071958acc432a4e8 (patch)
tree7053d9d5aa8d8a9380d3184e955b916e60419377 /include/net
parenta58db7ad80e89dab014bd2d769c233eeca1bf519 (diff)
downloadlinux-0974cff3eb66764cc86b60f1071958acc432a4e8.tar.xz
netfilter: add and use nft_set_do_lookup helper
Followup patch will add a CONFIG_RETPOLINE wrapper to avoid the ops->lookup() indirection cost for retpoline builds. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_tables_core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_tables_core.h b/include/net/netfilter/nf_tables_core.h
index fd10a7862fdc..5eb699454490 100644
--- a/include/net/netfilter/nf_tables_core.h
+++ b/include/net/netfilter/nf_tables_core.h
@@ -88,6 +88,13 @@ extern const struct nft_set_type nft_set_bitmap_type;
extern const struct nft_set_type nft_set_pipapo_type;
extern const struct nft_set_type nft_set_pipapo_avx2_type;
+static inline bool
+nft_set_do_lookup(const struct net *net, const struct nft_set *set,
+ const u32 *key, const struct nft_set_ext **ext)
+{
+ return set->ops->lookup(net, set, key, ext);
+}
+
struct nft_expr;
struct nft_regs;
struct nft_pktinfo;