All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 2/2 nft] scanner: fix parsing of tc handle
Date: Thu, 13 Feb 2014 11:51:12 +0000	[thread overview]
Message-ID: <20140213115112.GA30397@macbook.localnet> (raw)
In-Reply-To: <1392291672-7885-2-git-send-email-pablo@netfilter.org>

On Thu, Feb 13, 2014 at 12:41:12PM +0100, Pablo Neira Ayuso wrote:
> hexstring:hexstring
> hexstring:
> :hexstring
> ---
> The spaces to separate the key and the action in dictionaries is very
> important, otherwise (with this patch) the scanner misinterprets this.
> 
>  # nft add filter input tcp dport vmap { 25:drop }
>  <cmdline>:1:41-43: Error: syntax error, unexpected string, expecting comma or '}'
>  add rule filter input tcp dport vmap { 25:drop }
>                                         ^^^
> I think we can just document this, I don't see any better solution for this
> at this moment.

Let me try if I can come up with something ...

> 
>  src/scanner.l |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/scanner.l b/src/scanner.l
> index e4cb398..ea61fa0 100644
> --- a/src/scanner.l
> +++ b/src/scanner.l
> @@ -109,7 +109,7 @@ digit		[0-9]
>  hexdigit	[0-9a-fA-F]
>  decstring	{digit}+
>  hexstring	0[xX]{hexdigit}+
> -range		({decstring}?:{decstring}?)
> +priostring	{hexdigit}{0,4}:{hexdigit}{0,4}
>  letter		[a-zA-Z]
>  string		({letter})({letter}|{digit}|[/\-_\.])*
>  quotedstring	\"[^"]*\"
> @@ -447,6 +447,11 @@ addrstring	({macaddr}|{ip4addr}|{ip6addr})
>  				return STRING;
>  			}
>  
> +{priostring}		{
> +				yylval->string = xstrdup(yytext);
> +				return STRING;
> +			}
> +
>  \\{newline}		{
>  				reset_pos(yyget_extra(yyscanner), yylloc);
>  			}
> -- 
> 1.7.10.4

  reply	other threads:[~2014-02-13 11:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 11:41 [PATCH 1/2 nft] meta: remove line break when printing priority Pablo Neira Ayuso
2014-02-13 11:41 ` [PATCH 2/2 nft] scanner: fix parsing of tc handle Pablo Neira Ayuso
2014-02-13 11:51   ` Patrick McHardy [this message]
2014-02-13 13:01     ` Patrick McHardy
2014-02-13 13:08       ` Mart Frauenlob
2014-02-13 13:21         ` Patrick McHardy
2014-02-13 13:31       ` Pablo Neira Ayuso
2014-02-13 13:36         ` Patrick McHardy
2014-02-13 14:17           ` Patrick McHardy
2014-02-14 10:59             ` 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=20140213115112.GA30397@macbook.localnet \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.