From: Phil Sutter Date: Tue, 6 Feb 2018 18:18:47 +0000 (+0100) Subject: evaluate: Enable automerge feature for anonymous sets X-Git-Tag: v0.8.3~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb16c8b7f795e0dba5a2acea1b156a8796e75195;p=thirdparty%2Fnftables.git 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 Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- 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);