[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191113092005.23695425@shemminger-XPS-13-9360>
Date: Wed, 13 Nov 2019 09:20:05 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Roi Dayan <roid@...lanox.com>
Cc: netdev@...r.kernel.org, David Ahern <dsahern@...il.com>,
Jiri Pirko <jiri@...lanox.com>,
Eli Britstein <elibr@...lanox.com>
Subject: Re: [PATCH iproute2 1/5] tc_util: introduce a function to print
JSON/non-JSON masked numbers
On Wed, 13 Nov 2019 12:12:41 +0200
Roi Dayan <roid@...lanox.com> wrote:
> +
> + if (is_json_context()) {
> + sprintf(namefrm, "\n %s %%u", name);
> + print_hu(PRINT_ANY, name, namefrm,
> + rta_getattr_type(attr));
> + if (mask != type_max) {
> + char mask_name[SPRINT_BSIZE-6];
> +
> + sprintf(mask_name, "%s_mask", name);
> + sprintf(namefrm, "\n %s %%u", mask_name);
> + print_hu(PRINT_ANY, mask_name, namefrm, mask);
Should use _SL_ to handle single line output format case (instead of \n)
Powered by blists - more mailing lists