All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serhey Popovych <serhe.popovych@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH iproute2 1/7] ip6/tunnel: Fix tclass output
Date: Mon,  8 Jan 2018 19:06:32 +0200	[thread overview]
Message-ID: <1515431198-29362-2-git-send-email-serhe.popovych@gmail.com> (raw)
In-Reply-To: <1515431198-29362-1-git-send-email-serhe.popovych@gmail.com>

In link_gre6.c it seems copy paste error: tclass is 8 bits,
not 20 as flowlabel.

In link_iptnl.c rename "flowinfo_tclass" to "tclass" as it
correct name since flowinfo is implementation internal name
used to label combined within u32 attribute tclass and
flowlabel.

Fixes: 1facc1c61c07 ("ip: link_ip6tnl.c: add json output support")
Fixes: 2e706e12d9b0 ("Merge branch 'master' into net-next")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
---
 ip/link_gre6.c   |    2 +-
 ip/link_ip6tnl.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index 7ae4b49..87c313c 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -475,7 +475,7 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		if (is_json_context()) {
 			SPRINT_BUF(b1);
 
-			snprintf(b1, sizeof(b1), "0x%05x",
+			snprintf(b1, sizeof(b1), "0x%02x",
 				 ntohl(flowinfo & IP6_FLOWINFO_TCLASS) >> 20);
 			print_string(PRINT_JSON, "tclass", NULL, b1);
 		} else {
diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c
index 84205b1..8e84ed0 100644
--- a/ip/link_ip6tnl.c
+++ b/ip/link_ip6tnl.c
@@ -416,7 +416,7 @@ static void ip6tunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb
 			SPRINT_BUF(b1);
 
 			snprintf(b1, sizeof(b1), "0x%02x", (__u8)(val >> 20));
-			print_string(PRINT_JSON, "flowinfo_tclass", NULL, b1);
+			print_string(PRINT_JSON, "tclass", NULL, b1);
 		} else {
 			printf("tclass 0x%02x ", (__u8)(val >> 20));
 		}
-- 
1.7.10.4

  reply	other threads:[~2018-01-08 17:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 17:06 [PATCH iproute2 0/7] ip6/tunnel: Unify tclass, flowlabel and encap_limit output Serhey Popovych
2018-01-08 17:06 ` Serhey Popovych [this message]
2018-01-08 17:06 ` [PATCH iproute2 2/7] ip6tnl/tunnel: Do not print obscure flowinfo Serhey Popovych
2018-01-08 17:06 ` [PATCH iproute2 3/7] ip6/tunnel: Unify tclass printing Serhey Popovych
2018-01-08 17:06 ` [PATCH iproute2 4/7] ip6/tunnel: Unify flowlabel printing Serhey Popovych
2018-01-08 17:06 ` [PATCH iproute2 5/7] ip6/tunnel: Unify encap_limit printing Serhey Popovych
2018-01-08 17:06 ` [PATCH iproute2 6/7] gre6/tunnel: Output flowlabel after tclass Serhey Popovych
2018-01-08 17:06 ` [PATCH iproute2 7/7] ip6tnl/tunnel: Output hoplimit before encapsulation limit Serhey Popovych
2018-01-09 16:12 ` [PATCH iproute2 0/7] ip6/tunnel: Unify tclass, flowlabel and encap_limit output Stephen Hemminger
2018-01-10 15:35   ` Serhey Popovych

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=1515431198-29362-2-git-send-email-serhe.popovych@gmail.com \
    --to=serhe.popovych@gmail.com \
    --cc=netdev@vger.kernel.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.