]> 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>
Tue, 17 Jun 2025 09:17:27 +0000 (11:17 +0200)
commit1aa2909460b8cdf06e53ac56090daba131934e30
tree25a257202d762679b860d6f4f506d12e689da489
parentf17991d56c44cf308a6fdae088456c3a5dffd939
intervals: set internal element location with the deletion trigger

commit 93077e35accccd8cc056b67f70bfb3182c819fd4 upstream.

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