]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
evaluate: Enable automerge feature for anonymous sets
authorPhil Sutter <phil@nwl.cc>
Tue, 6 Feb 2018 18:18:47 +0000 (19:18 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 15 Feb 2018 15:29:25 +0000 (16:29 +0100)
Automatic merging of adjacent/overlapping ranges upon insertion has
clear benefits performance- and readability-wise. The drawbacks which
led to disabling it by default don't apply to anonymous sets since they
are read-only anyway, so enable this feature for them again.

Cc: Jeff Kletsky <netfilter@allycomm.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c

index bcdd2dfd857f39f77216f10fece018252a9d2620..8107df838a9093b6d3c3dbcbcfb8c4c8c01fd839 100644 (file)
@@ -87,6 +87,7 @@ static struct expr *implicit_set_declaration(struct eval_ctx *ctx,
        set->handle.set = xstrdup(name);
        set->key        = key;
        set->init       = expr;
+       set->automerge  = set->flags & NFT_SET_INTERVAL;
 
        if (ctx->table != NULL)
                list_add_tail(&set->list, &ctx->table->sets);