summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-02-06 19:18:47 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-02-15 16:29:25 +0100
commitfb16c8b7f795e0dba5a2acea1b156a8796e75195 (patch)
treecd133f305dc4386d9622c867dd9e2ae9202e2c09
parentb6143aa55eb8efa715d2511844790dd92cdaa483 (diff)
evaluate: Enable automerge feature for anonymous sets
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>
-rw-r--r--src/evaluate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index bcdd2dfd..8107df83 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -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);