netfilter: nft_set: remove one argument from lookup and update functions
authorFlorian Westphal <fw@strlen.de>
Wed, 9 Jul 2025 17:05:13 +0000 (19:05 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 25 Jul 2025 16:40:16 +0000 (18:40 +0200)
commit17a20e09f086f2c574ac87f3cf6e14c4377f65f6
tree718c19bff842cfcbf2ef90df467e0ae63562a477
parent7792c1e03054440c60d4bce0c06a31c134601997
netfilter: nft_set: remove one argument from lookup and update functions

Return the extension pointer instead of passing it as a function
argument to be filled in by the callee.

As-is, whenever false is returned, the extension pointer is not used.

For all set types, when true is returned, the extension pointer was set
to the matching element.

Only exception: nft_set_bitmap doesn't support extensions.
Return a pointer to a static const empty element extension container.

return false -> return NULL
return true -> return the elements' extension pointer.

This saves one function argument.

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
include/net/netfilter/nf_tables_core.h
net/netfilter/nft_dynset.c
net/netfilter/nft_lookup.c
net/netfilter/nft_objref.c
net/netfilter/nft_set_bitmap.c
net/netfilter/nft_set_hash.c
net/netfilter/nft_set_pipapo.c
net/netfilter/nft_set_pipapo_avx2.c
net/netfilter/nft_set_rbtree.c