]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
evaluate: add flowtable to the cache
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 15 Apr 2021 12:00:20 +0000 (14:00 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 2 May 2021 21:30:35 +0000 (23:30 +0200)
If the cache does not contain this flowtable that is defined in this
batch, then add it to the cache. This allows for references to this new
flowtable in the same batch.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c

index 02115101fec36c321c8d0c392a4ca3be3bf55be1..f4c1acef0b167eaa125629a6c04fcce768e2958c 100644 (file)
@@ -3961,6 +3961,9 @@ static int flowtable_evaluate(struct eval_ctx *ctx, struct flowtable *ft)
        if (table == NULL)
                return table_not_found(ctx);
 
+       if (!ft_cache_find(table, ft->handle.flowtable.name))
+               ft_cache_add(flowtable_get(ft), table);
+
        if (ft->hook.name) {
                ft->hook.num = str2hooknum(NFPROTO_NETDEV, ft->hook.name);
                if (ft->hook.num == NF_INET_NUMHOOKS)