From: Pablo Neira Date: Mon, 13 Jan 2014 12:39:16 +0000 (+0100) Subject: expression: fix output of verdict maps X-Git-Tag: v0.099~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734eed347ff1b648b57940af482452d09337282c;p=thirdparty%2Fnftables.git expression: fix output of verdict maps % 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 --- diff --git a/src/expression.c b/src/expression.c index 518f71c8..a12133c8 100644 --- a/src/expression.c +++ b/src/expression.c @@ -691,7 +691,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); }