All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Phil Sutter <phil@nwl.cc>
Cc: Jiri Pirko <jiri@mellanox.com>, netdev@vger.kernel.org
Subject: Re: [iproute PATCH] tc: htb: Print default value in hex
Date: Mon, 22 Oct 2018 09:56:23 -0700	[thread overview]
Message-ID: <20181022095623.6ffabb31@xeon-e3> (raw)
In-Reply-To: <20181019154255.25749-1-phil@nwl.cc>

On Fri, 19 Oct 2018 17:42:55 +0200
Phil Sutter <phil@nwl.cc> wrote:

> 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.
> 
> Fixes: f354fa6aa5ff0 ("tc: jsonify htb qdisc")
> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
>  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..c69485db8ef7d 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_uint(PRINT_ANY, "default", " default %x", gopt->defcls);
>  		print_uint(PRINT_ANY, "direct_packets_stat",
>  			   " direct_packets_stat %u", gopt->direct_pkts);
>  		if (show_details) {

The output should be in hex. Because you used print_uint it will still be in decimal
in the JSON output.  The correct fix here is to use print_0xhex instead.

Please fix that, test it, and resubmit.

  reply	other threads:[~2018-10-23  1:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 15:42 [iproute PATCH] tc: htb: Print default value in hex Phil Sutter
2018-10-22 16:56 ` Stephen Hemminger [this message]
2018-10-22 17:28   ` Phil Sutter

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=20181022095623.6ffabb31@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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.