From: Pablo Neira Ayuso Date: Thu, 15 Apr 2021 12:00:16 +0000 (+0200) Subject: evaluate: add set to the cache X-Git-Tag: v0.9.9~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67d3969a72443c228b8fc198e42c7c508dbfe41a;p=thirdparty%2Fnftables.git evaluate: add set to the cache If the cache does not contain the set that is defined in this batch, add it to the cache. This allows for references to this new set in the same batch. Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/evaluate.c b/src/evaluate.c index 8f35ca59..02115101 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -3754,6 +3754,10 @@ static int set_evaluate(struct eval_ctx *ctx, struct set *set) if (table == NULL) return table_not_found(ctx); + if (!(set->flags & NFT_SET_ANONYMOUS) && + !set_cache_find(table, set->handle.set.name)) + set_cache_add(set_get(set), table); + if (!(set->flags & NFT_SET_INTERVAL) && set->automerge) return set_error(ctx, set, "auto-merge only works with interval sets");