netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] expression: fix output of verdict maps
@ 2014-01-13 12:39 Pablo Neira Ayuso
  2014-01-13 12:42 ` Patrick McHardy
  2014-01-16 16:53 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 8+ messages in thread
From: Pablo Neira Ayuso @ 2014-01-13 12:39 UTC (permalink / raw)
  To: netfilter-devel

% nft list table filter
table ip filter {
	...
	chain output {
		...
		ip saddr map { 1.1.1.1 => accept}
	}
}

It displays 'map' instead of 'vmap'. Fix it by checking the mapping
type in map_expr_print().

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/expression.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/expression.c b/src/expression.c
index 71154cc..97481d0 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -689,7 +689,11 @@ struct expr *mapping_expr_alloc(const struct location *loc,
 static void map_expr_print(const struct expr *expr)
 {
 	expr_print(expr->map);
-	printf(" map ");
+	if (expr->mappings->ops->type == EXPR_SET_REF &&
+	    expr->mappings->set->datatype->type == TYPE_VERDICT)
+		printf(" vmap ");
+	else
+		printf(" map ");
 	expr_print(expr->mappings);
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-16 17:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 12:39 [PATCH nft] expression: fix output of verdict maps Pablo Neira Ayuso
2014-01-13 12:42 ` Patrick McHardy
2014-01-14  9:00   ` Patrick McHardy
2014-01-14 11:29     ` Pablo Neira Ayuso
2014-01-14 12:33       ` Patrick McHardy
2014-01-16 16:53 ` Pablo Neira Ayuso
2014-01-16 16:57   ` Patrick McHardy
2014-01-16 17:03     ` 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).