]> git.ipfire.org Git - thirdparty/nftables.git/commit
intervals: set internal element location with the deletion trigger
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 4 Dec 2024 22:36:05 +0000 (23:36 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 2 Jan 2025 18:58:11 +0000 (19:58 +0100)
commit93077e35accccd8cc056b67f70bfb3182c819fd4
treebec000fbacbd5671826b4e356c7ac83000cbbca8
parent02dbf86f39410900d8f2e3e9cbac0b5f14dbd871
intervals: set internal element location with the deletion trigger

set location of internal elements (already in the kernel) to the one
that partial or fully deletes it.

Otherwise, error reporting refers to internal location.

Before this patch:

 # nft delete element x y { 1.1.1.3 }
 Error: Could not process rule: Too many open files in system
 delete element x y { 1.1.1.3 }
                      ^^^^^^^

After this patch:

 # nft delete element x y { 1.1.1.3 }
 Error: Could not process rule: Too many open files in system
 delete element x y { 1.1.1.3 }
                      ^^^^^^^

This occurs after splitting an existing interval in two:

 remove: [1010100-10101ff]
 add: [1010100-1010102]
 add: [1010104-10101ff]

which results in two additions after removing the existing interval
that is split.

Fixes: 81e36530fcac ("src: replace interval segment tree overlap and automerge")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/intervals.c