]> git.ipfire.org Git - thirdparty/nftables.git/commit
mnl: restore create element command with large batches
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Jan 2026 11:59:26 +0000 (12:59 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Jan 2026 11:59:26 +0000 (12:59 +0100)
commite83e32c8d1cd228d751fb92b756306c6eb6c0759
tree80aade7a1adff63404b1bd4158dfc6a4131fdc04
parenta9ead6a808dbe637ae7b9f54598f0dff9582d34d
mnl: restore create element command with large batches

The rework to reduce memory consumption has introduced a bug that result
in spurious EEXIST with large batches.

The code that tracks the start and end elements of the interval can add
the same element twice to the batch. This works with the add element
command, since it ignores EEXIST error, but it breaks the the create
element command.

Update this codepath to ensure both sides of the interval fit into the
netlink message, otherwise, trim the netlink message to remove them.
So the next netlink message includes the elements that represent the
interval that could not fit.

Fixes: 91dc281a82ea ("src: rework singleton interval transformation to reduce memory consumption")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/mnl.c