netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsahern@kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Hangbin Liu <liuhangbin@gmail.com>
Subject: [PATCH iproute2] u32: fix TC_U32_TERMINAL printing
Date: Tue, 28 Feb 2023 11:49:55 +0800	[thread overview]
Message-ID: <20230228034955.1215122-1-liuhangbin@gmail.com> (raw)

We previously printed an asterisk if there was no 'sel' or 'TC_U32_TERMINAL'
flag. However, commit 1ff22754 ("u32: fix json formatting of flowid")
changed the logic to print an asterisk only if there is a 'TC_U32_TERMINAL'
flag. Therefore, we need to fix this regression.

Fixes: 1ff227545ce1 ("u32: fix json formatting of flowid")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tc/f_u32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/f_u32.c b/tc/f_u32.c
index bfe9e5f9..de2d0c9e 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -1273,7 +1273,7 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
 	if (tb[TCA_U32_CLASSID]) {
 		__u32 classid = rta_getattr_u32(tb[TCA_U32_CLASSID]);
 		SPRINT_BUF(b1);
-		if (sel && (sel->flags & TC_U32_TERMINAL))
+		if (!sel || !(sel->flags & TC_U32_TERMINAL))
 			print_string(PRINT_FP, NULL, "*", NULL);
 
 		print_string(PRINT_ANY, "flowid", "flowid %s ",
-- 
2.38.1


             reply	other threads:[~2023-02-28  3:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28  3:49 Hangbin Liu [this message]
2023-02-28 10:55 ` [PATCH iproute2] u32: fix TC_U32_TERMINAL printing Jamal Hadi Salim
2023-03-01  3:10   ` Hangbin Liu
2023-03-01  3:24     ` Hangbin Liu
2023-03-01 11:55     ` Jamal Hadi Salim

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=20230228034955.1215122-1-liuhangbin@gmail.com \
    --to=liuhangbin@gmail.com \
    --cc=dsahern@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).