Thread (9 messages) 9 messages, 6 authors, 2018-12-03

Lifecycle

  1. Posted Phil Sutter <phil@nwl.cc>
  2. Reported-by Eric Dumazet

[iproute PATCH] ssfilter: Fix for inverted last expression

From: Phil Sutter <phil@nwl.cc>
Date: 2018-11-29 23:26:01
Subsystem: the rest · Maintainer: Linus Torvalds

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 <edumazet@google.com>
Fixes: b2038cc0b2403 ("ssfilter: Eliminate shift/reduce conflicts")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help