]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
evaluate: return ctx->table from table_lookup_global()
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 1 Dec 2016 10:32:58 +0000 (11:32 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 1 Dec 2016 11:32:42 +0000 (12:32 +0100)
Instead of returning ctx->cmd->table. Note that ctx->cmd->table and
ctx->table points to the same object when all commands are embedded into
the table definition. But this is not true if we mix table definitions
with linear list commands in one file that we load via nft -f.

Reported-by: Martin Bednar <martin@serafean.cz>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c

index c75c1407d6e668bc89e8c3ad96b268ab02924b0a..e11a455a5f53aa259b6e20d89b439b85eca30b3e 100644 (file)
@@ -140,7 +140,7 @@ static struct table *table_lookup_global(struct eval_ctx *ctx)
        struct table *table;
 
        if (ctx->table != NULL)
-               return ctx->cmd->table;
+               return ctx->table;
 
        table = table_lookup(&ctx->cmd->handle);
        if (table == NULL)