netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Eric Leblond <eric@regit.org>
Cc: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] parser: simplify monitor command parsing
Date: Wed, 24 Sep 2014 13:42:57 +0200	[thread overview]
Message-ID: <20140924114257.GD18799@acer.localdomain> (raw)
In-Reply-To: <1411548406.10103.1.camel@regit.org>

On Wed, Sep 24, 2014 at 10:46:46AM +0200, Eric Leblond wrote:
> Hi,
> 
> On Wed, 2014-09-17 at 10:01 +0200, Patrick McHardy wrote:
> > On Wed, Sep 17, 2014 at 09:52:11AM +0200, Arturo Borrero Gonzalez wrote:
> > > On 17 September 2014 09:45, Patrick McHardy <kaber@trash.net> wrote:
> > > > Add tokens for "new" and "destroy". Split up the monitor flags into an
> > > > event and an object to avoid lots of duplicated code.
> > > >
> > > > Signed-off-by: Patrick McHardy <kaber@trash.net>
> > > > ---
> > > 
> > > I think the 'new' keyword may clash with 'ct new', don't you?. That's
> > > why Pablo did the parser that way.
> > 
> > Right. The split into event and object still saves a lot of code, I'll
> > add back the strcmp if I can't think of a nicer way to fix this.
> > 
> > I'm working on command line completion based on the bison grammar, so
> > I'd prefer to only use strings for identifiers, not for keywords.
> 
> I confirm that 102c300 "parser: simplify monitor command parsing" breaks
> the "ct state new" filter so current nftables git is not usable. 
> 
> For the record the error is the following:
>  nft> add rule inet filter input ct state new
>  <cli>:1:37-39: Error: syntax error, unexpected new
>  add rule inet filter input ct state new
>                                      ^^^ 
> 
> And this is also caught by regression tests:
> nftables/tests/regression# ./nft-test.py any/ct.t 
> any/ct.t: ERROR: line 10: nft add rule -nnn ip test-ip4 output ct state new,established, related, untracked: This rule should not have failed.
> any/ct.t: ERROR: line 12: nft add rule -nnn ip test-ip4 output ct state {new,established, related, untracked}: This rule should not have failed.
> 
> Patrick, let me know if you can look into it. If not I will try to have
> a look this week end or next week.

I have a rather large patchset that reorganizes the parser and fixes
this for all constants that clash with keywords, but it will take a
day or two.

      reply	other threads:[~2014-09-24 11:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17  7:45 [PATCH] parser: simplify monitor command parsing Patrick McHardy
2014-09-17  7:52 ` Arturo Borrero Gonzalez
2014-09-17  8:01   ` Patrick McHardy
2014-09-24  8:46     ` Eric Leblond
2014-09-24 11:42       ` Patrick McHardy [this message]

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=20140924114257.GD18799@acer.localdomain \
    --to=kaber@trash.net \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=eric@regit.org \
    --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 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).