netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: kaber@trash.net
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] expression: fix output of verdict maps
Date: Thu, 16 Jan 2014 17:53:37 +0100	[thread overview]
Message-ID: <20140116165337.GA5205@localhost> (raw)
In-Reply-To: <1389616756-8326-1-git-send-email-pablo@netfilter.org>

On Mon, Jan 13, 2014 at 01:39:16PM +0100, Pablo Neira Ayuso wrote:
> % 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().

Spinning over the list of pending stuff in my notepad before the
release.

I think it's not so bad if we keep the 'vmap' for verdict maps. This
can just become a synonym of 'map' if we ever find the way to make it
work without ambiguity complains from the parser.

> 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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-01-16 16:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-01-16 16:57   ` Patrick McHardy
2014-01-16 17:03     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140116165337.GA5205@localhost \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).