]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
segtree: set on EXPR_F_KERNEL flag for catchall elements in the cache
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 4 Jul 2024 12:35:07 +0000 (14:35 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Jan 2025 00:35:36 +0000 (01:35 +0100)
commit dc6950a80110d6e6f63bd6f5c308d202db698f46 upstream.

Catchall set element deletion requires this flag to be set on,
otherwise it bogusly reports that such element does not exist
in the set.

Fixes: f1cc44edb218 ("src: add EXPR_F_KERNEL to identify expression in the kernel")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/segtree.c

index 0e3d111fb7aba4a91a2a1af99e4ce5e3ecd4cf28..b8fa9389f561f251012f44a65358daf4e7aa8ffd 100644 (file)
@@ -630,8 +630,10 @@ void interval_map_decompose(struct expr *set)
        expr_free(i);
 
 out:
-       if (catchall)
+       if (catchall) {
+               catchall->flags |= EXPR_F_KERNEL;
                compound_expr_add(set, catchall);
+       }
 
        xfree(ranges);
        xfree(elements);