From: Phil Sutter Subject: [iproute PATCH v2] tc: htb: Print default value in hex Date: Tue, 23 Oct 2018 12:36:24 +0200 Message-ID: <20181023103624.6263-1-phil@nwl.cc> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from orbyte.nwl.cc ([151.80.46.58]:48258 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbeJWS70 (ORCPT ); Tue, 23 Oct 2018 14:59:26 -0400 Sender: netdev-owner@vger.kernel.org List-ID: Value of 'default' is assumed to be hexadecimal when parsing, so consequently it should be printed in hex as well. This is a regression introduced when adding JSON output. As requested, also change JSON output to print the value as hex string. Fixes: f354fa6aa5ff0 ("tc: jsonify htb qdisc") Signed-off-by: Phil Sutter --- Changes since v1: - Use print_0xhex(). --- tc/q_htb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/q_htb.c b/tc/q_htb.c index c8b2941d945b7..5fb11d28c5c3a 100644 --- a/tc/q_htb.c +++ b/tc/q_htb.c @@ -332,7 +332,7 @@ static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) if (RTA_PAYLOAD(tb[TCA_HTB_INIT]) < sizeof(*gopt)) return -1; print_int(PRINT_ANY, "r2q", "r2q %d", gopt->rate2quantum); - print_uint(PRINT_ANY, "default", " default %u", gopt->defcls); + print_0xhex(PRINT_ANY, "default", " default %x", gopt->defcls); print_uint(PRINT_ANY, "direct_packets_stat", " direct_packets_stat %u", gopt->direct_pkts); if (show_details) { -- 2.19.0