]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
evaluate: auto-merge is only available for singleton interval sets
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 20 Feb 2025 16:55:15 +0000 (17:55 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 21 Feb 2025 22:23:16 +0000 (23:23 +0100)
auto-merge is only available to interval sets with one value only,
untoggle this flag for concatenation with intervals.

Later, this can be hardened to reject it.

Fixes: 30f667920601 ("src: add 'auto-merge' option to sets")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c

index 3cf58d85e41466b95ebdb525b611cf48b3270a38..ddc46754fc675556b73c34a22aab6a37dc0bdf13 100644 (file)
@@ -5041,6 +5041,9 @@ static int set_evaluate(struct eval_ctx *ctx, struct set *set)
                       sizeof(set->desc.field_len));
                set->desc.field_count = set->key->field_count;
                set->flags |= NFT_SET_CONCAT;
+
+               if (set->automerge)
+                       set->automerge = false;
        }
 
        if (set_is_anonymous(set->flags) && set->key->etype == EXPR_CONCAT) {