From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH] parser_bison: Allow parens on RHS of relational_expr
Date: Tue, 29 Nov 2016 22:19:31 +0100 [thread overview]
Message-ID: <20161129211931.GA6409@salvia> (raw)
In-Reply-To: <20161128175143.25201-1-phil@nwl.cc>
On Mon, Nov 28, 2016 at 06:51:43PM +0100, Phil Sutter wrote:
> This is useful to allow a construct such as:
>
> | tcp flags & (syn|fin) == (syn|fin)
>
> Before, only the parentheses on the left side were allowed, but via a
> quite funny path through the parser:
>
> * expr might be a concat_expr
> * concat_expr might be a basic_expr
> * basic_expr is an inclusive_or_expr
> * inclusive_or_expr might be an exclusive_or_expr
> * exclusive_or_expr might be an and_expr
> * and_expr might be 'and_expr AMPERSAND shift_expr'
> -> here we eliminate 'flags &' in above statement
> * shift_expr might be a primary_expr
> * primary_expr might be '( basic_expr )'
>
> Commit a3e60492a684b ("parser: restrict relational rhs expression
> recursion") introduced rhs_expr to disallow recursion on RHS, so just
> reverting that change for relational_expr is a no go. Allowing rhs_expr
> to be '( rhs_expr )' though seems way too intrusive to me since it's
> being used in all kinds of places, so this patch is the safest way to
> allow the above I could come up with.
Applied, thanks Phil!
prev parent reply other threads:[~2016-11-29 21:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 17:51 [nft PATCH] parser_bison: Allow parens on RHS of relational_expr Phil Sutter
2016-11-29 21:19 ` Pablo Neira Ayuso [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=20161129211931.GA6409@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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