]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfilter: nf_tables: allocate element update information dynamically
authorFlorian Westphal <fw@strlen.de>
Wed, 13 Nov 2024 15:35:53 +0000 (16:35 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 Nov 2024 12:05:49 +0000 (13:05 +0100)
commit508180850b732c7a0e3a728460cf3f95f25e1fbd
treec962ca63c29191340956a43d744f0724e1d313c6
parentb0c49466043a4878d8ef1263a4c9020698958a4c
netfilter: nf_tables: allocate element update information dynamically

Move the timeout/expire/flag members from nft_trans_one_elem struct into
a dybamically allocated structure, only needed when timeout update was
requested.

This halves size of nft_trans_one_elem struct and allows to compact up to
124 elements in one transaction container rather than 62.

This halves memory requirements for a large flush or insert transaction,
where ->update remains NULL.

Care has to be taken to release the extra data in all spots, including
abort path.

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