From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: [PATCH iproute2 1/7] ip6/tunnel: Fix tclass output Date: Mon, 8 Jan 2018 19:06:32 +0200 Message-ID: <1515431198-29362-2-git-send-email-serhe.popovych@gmail.com> References: <1515431198-29362-1-git-send-email-serhe.popovych@gmail.com> To: netdev@vger.kernel.org Return-path: Received: from mail-lf0-f65.google.com ([209.85.215.65]:46232 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933287AbeAHRGo (ORCPT ); Mon, 8 Jan 2018 12:06:44 -0500 Received: by mail-lf0-f65.google.com with SMTP id a12so12836962lfe.13 for ; Mon, 08 Jan 2018 09:06:43 -0800 (PST) Received: from tuxracer.localdomain ([2a01:6d80::195:20:96:53]) by smtp.gmail.com with ESMTPSA id y138sm2221484lfd.62.2018.01.08.09.06.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:06:42 -0800 (PST) In-Reply-To: <1515431198-29362-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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