diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-04-15 14:00:16 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-02 23:30:35 +0200 |
commit | 67d3969a72443c228b8fc198e42c7c508dbfe41a (patch) | |
tree | e523b5edf6179c1a60f0cefeff290b9ed4cb056e /src/evaluate.c | |
parent | 56d5d7b0d445f66f7ba42d26d5cc535926c0426b (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 4 |
1 files changed, 4 insertions, 0 deletions
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"); |