]> git.ipfire.org Git - thirdparty/nftables.git/commit
mnl: do not send set size when set is constant set
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 Jan 2025 16:41:01 +0000 (17:41 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 10 Jan 2025 10:21:02 +0000 (11:21 +0100)
commit9ed7cae9f30cb4cb1a2392e4d9ce2ee38aec79bf
tree79b95de470ee19b7449a23dea7d10c279c33d4b6
parent9cfce32ab5671a260c64f247e44c17faebc9001e
mnl: do not send set size when set is constant set

When turning element range into the interval representation based on
singleton elements for the rbtree tree set backend, userspace adjusts
the size to the internal kernel implementation.

For constant sets, this is leaking an internal kernel implementation
detail that is fixed by kernel patch ("netfilter: nf_tables: fix set
size with rbtree backend"). For non-constant sets, set size is just
broken.

This patch is required by the follow up patch ("src: rework singleton
interval transformation to reduce memory consumption").

On top of this, constant sets cannot be updated once they are bound, set
size is not useful in this case. Remove this implicit set size for
constant sets.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/mnl.c