All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	David Ahern <dsahern@gmail.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [iproute PATCH] ssfilter: Fix for inverted last expression
Date: Thu, 29 Nov 2018 13:20:37 +0100	[thread overview]
Message-ID: <20181129122037.10569-1-phil@nwl.cc> (raw)
In-Reply-To: <CANn89i+fMWHyiT2o13oE99u46LaBQCDRtnigojZqy803yUnK2w@mail.gmail.com>

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

  reply	other threads:[~2018-11-29 23:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 22:29 [PATCH iproute2] ss: add support for delivered and delivered_ce fields Eric Dumazet
2018-11-26 22:37 ` Yuchung Cheng
2018-11-29  0:01 ` Stephen Hemminger
2018-11-29  5:10   ` Eric Dumazet
2018-11-29  5:16     ` David Ahern
2018-11-29  5:25       ` Eric Dumazet
2018-11-29 12:20         ` Phil Sutter [this message]
2018-11-30 18:22           ` [iproute PATCH] ssfilter: Fix for inverted last expression Eric Dumazet
2018-12-03 22:38           ` Stephen Hemminger

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=20181129122037.10569-1-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.