From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Sutter Subject: [iproute PATCH] ssfilter: Fix for inverted last expression Date: Thu, 29 Nov 2018 13:20:37 +0100 Message-ID: <20181129122037.10569-1-phil@nwl.cc> References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, Eric Dumazet , David Ahern , Eric Dumazet To: Stephen Hemminger Return-path: Received: from orbyte.nwl.cc ([151.80.46.58]:43256 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbeK2X0B (ORCPT ); Thu, 29 Nov 2018 18:26:01 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: When fixing for shift/reduce conflicts, possibility to invert the last expression by prefixing with '!' or 'not' was accidentally removed. Fix this by allowing for expr to be an inverted expr so that any reference to it in exprlist accepts the inverted prefix. Reported-by: Eric Dumazet Fixes: b2038cc0b2403 ("ssfilter: Eliminate shift/reduce conflicts") Signed-off-by: Phil Sutter --- misc/ssfilter.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/ssfilter.y b/misc/ssfilter.y index 0413dddaa7584..a901ae753a284 100644 --- a/misc/ssfilter.y +++ b/misc/ssfilter.y @@ -54,10 +54,6 @@ null: /* NOTHING */ { $$ = NULL; } ; exprlist: expr - | '!' expr - { - $$ = alloc_node(SSF_NOT, $2); - } | exprlist '|' expr { $$ = alloc_node(SSF_OR, $1); @@ -83,6 +79,10 @@ expr: '(' exprlist ')' { $$ = $2; } + | '!' expr + { + $$ = alloc_node(SSF_NOT, $2); + } | DCOND eq HOSTCOND { $$ = alloc_node(SSF_DCOND, $3); -- 2.19.0