From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: Netfilter Development Mailing list <netfilter-devel@vger.kernel.org>
Subject: Re: [nft PATCH] src: add tee statement support
Date: Tue, 10 Mar 2015 12:34:45 +0100 [thread overview]
Message-ID: <20150310113445.GA3814@salvia> (raw)
In-Reply-To: <CAOkSjBhq2z0kmq3Xd_smgcj+JoVCn7kEJHCRz2ccRc5FTVpiGw@mail.gmail.com>
On Tue, Mar 10, 2015 at 11:31:00AM +0100, Arturo Borrero Gonzalez wrote:
> On 9 March 2015 at 20:38, Arturo Borrero Gonzalez
> <arturo.borrero.glez@gmail.com> wrote:
> > The syntax is:
> > tee gw <addr> [oifname <str>]
> >
> [...]
> >
> > +tee_stmt : tee_stmt_alloc tee_stmt_opt
> > + ;
> > +
> > +tee_stmt_alloc : TEE
> > + {
> > + $$ = tee_stmt_alloc(&@$);
> > + }
> > + ;
> > +
> > +tee_stmt_opt : GW expr
> > + {
> > + $<stmt>0->tee.gw = $2;
> > + }
> > + | OIFNAME STRING
> > + {
> > + $<stmt>0->tee.oifname = strdup($2);
> > + }
> > + ;
> > +
>
> This grammar is not completely right.
>
> However, using something like this:
>
> tee_stmt : TEE tee_stmt_opts
> {
> $$ = tee_stmt_alloc(&@$);
> }
> ;
>
> tee_stmt_opts : tee_stmt_opts tee_stmt_opt
> | tee_stmt_opt
> ;
>
> tee_stmt_opt : GW expr
> {
> $<stmt>0->tee.gw = $2;
> }
> | OIFNAME string
> {
> $<stmt>0->tee.oifname = strdup($2);
> }
> ;
>
> lead to shift/reduce conflicts, because expr can be `OIFNAME string'.
>
> Any idea?
You use STRING instead for GW and make sure from the evaluation step
that this is a valid address?
next prev parent reply other threads:[~2015-03-10 11:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 19:38 [nft PATCH] src: add tee statement support Arturo Borrero Gonzalez
2015-03-10 10:31 ` Arturo Borrero Gonzalez
2015-03-10 11:34 ` Pablo Neira Ayuso [this message]
2015-03-10 13:12 ` Arturo Borrero Gonzalez
2015-03-10 15:51 ` Patrick McHardy
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=20150310113445.GA3814@salvia \
--to=pablo@netfilter.org \
--cc=arturo.borrero.glez@gmail.com \
--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 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.