From: Phil Sutter Date: Thu, 29 Nov 2018 12:20:37 +0000 (+0100) Subject: ssfilter: Fix for inverted last expression X-Git-Tag: v4.20.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6495bca92e08000b1a5ad95f9db4ef62b746bebf;p=thirdparty%2Fiproute2.git ssfilter: Fix for inverted last expression 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 Acked-by: Eric Dumazet Signed-off-by: Stephen Hemminger --- diff --git a/misc/ssfilter.y b/misc/ssfilter.y index 0413dddaa..a901ae753 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);