netfilter: nf_tables: prepare for multiple elements in nft_trans_elem structure
authorFlorian Westphal <fw@strlen.de>
Wed, 13 Nov 2024 15:35:50 +0000 (16:35 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 Nov 2024 11:40:37 +0000 (12:40 +0100)
commita8ee6b900c147d3bedced6c52ba6cb603226aaa3
tree0e70acd4824e6208b0c1221685cbf4d38d471730
parent4ee29181216d2acb7be210126324ec3bc0e3bd01
netfilter: nf_tables: prepare for multiple elements in nft_trans_elem structure

Add helpers to release the individual elements contained in the
trans_elem container structure.

No functional change intended.

Followup patch will add 'nelems' member and will turn 'priv' into
a flexible array.

These helpers can then loop over all elements.
Care needs to be taken to handle a mix of new elements and existing
elements that are being updated (e.g. timeout refresh).

Before this patch, NEWSETELEM transaction with update is released
early so nft_trans_set_elem_destroy() won't get called, so we need
to skip elements marked as update.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c