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>
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");