netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] evaluate: return ctx->table from table_lookup_global()
@ 2016-12-01 11:23 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2016-12-01 11:23 UTC (permalink / raw)
  To: netfilter-devel; +Cc: martin

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index c841aafd98a0..cf7ecb96e3b2 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -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)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-01 11:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01 11:23 [PATCH nft] evaluate: return ctx->table from table_lookup_global() Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).