From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: [nft PATCH] src: add tee statement support Date: Tue, 10 Mar 2015 12:34:45 +0100 Message-ID: <20150310113445.GA3814@salvia> References: <20150309193820.6763.36920.stgit@nfdev.cica.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Netfilter Development Mailing list To: Arturo Borrero Gonzalez Return-path: Received: from mail.us.es ([193.147.175.20]:40390 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbbCJLbB (ORCPT ); Tue, 10 Mar 2015 07:31:01 -0400 Content-Disposition: inline In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Tue, Mar 10, 2015 at 11:31:00AM +0100, Arturo Borrero Gonzalez wrote: > On 9 March 2015 at 20:38, Arturo Borrero Gonzalez > wrote: > > The syntax is: > > tee gw [oifname ] > > > [...] > > > > +tee_stmt : tee_stmt_alloc tee_stmt_opt > > + ; > > + > > +tee_stmt_alloc : TEE > > + { > > + $$ = tee_stmt_alloc(&@$); > > + } > > + ; > > + > > +tee_stmt_opt : GW expr > > + { > > + $0->tee.gw = $2; > > + } > > + | OIFNAME STRING > > + { > > + $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 > { > $0->tee.gw = $2; > } > | OIFNAME string > { > $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?