Re: [nft PATCH] src: add tee statement support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10.03, Pablo Neira Ayuso wrote:
> 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@xxxxxxxxx> 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?

Never use string please, it breaks symbol resolution. symbol_expr would
be a better choice.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux