lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Dec 2022 09:19:06 +0000
From:   <Daniel.Machon@...rochip.com>
To:     <stephen@...workplumber.org>
CC:     <netdev@...r.kernel.org>, <dsahern@...nel.org>, <petrm@...dia.com>,
        <maxime.chevallier@...tlin.com>, <vladimir.oltean@....com>,
        <UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH iproute2-next v3 1/2] dcb: add new pcp-prio parameter to
 dcb app

> > > On Fri, 2 Dec 2022 10:22:34 +0100
> > > Daniel Machon <daniel.machon@...rochip.com> wrote:
> > >
> > > > +static int dcb_app_print_key_pcp(__u16 protocol)
> > > > +{
> > > > +     /* Print in numerical form, if protocol value is out-of-range */
> > > > +     if (protocol > DCB_APP_PCP_MAX) {
> > > > +             fprintf(stderr, "Unknown PCP key: %d\n", protocol);
> > > > +             return print_uint(PRINT_ANY, NULL, "%d:", protocol);
> > > > +     }
> > > > +
> > > > +     return print_string(PRINT_ANY, NULL, "%s:", pcp_names[protocol]);
> > > > +}
> > >
> > > This is not an application friendly way to produce JSON output.
> > > You need to put a key on each one, and value should not contain colon.
> >
> > Hi Stephen,
> >
> > Trying to understand your comment.
> >
> > Are you talking about not producing any JSON output with the symbolic
> > PCP values? eg. ["1de", 1] -> [8, 1]. So basically print with PRINT_FP
> > in case of printing in JSON context?
> >
> > /Daniel
> 
> What does output look like in json and non-json versions?

non-JSON: pcp-prio 1de:1
JSON    : {"pcp_prio":[["1de",1]]}

> My concern that the json version would be awkward and have colons in it, but looks
> like it won't.

Yeah, the "%s:" format is only used in non-JSON context, so we are good
here.

> 
> For the unknown key type is printing error necessary? Maybe just show it in numeric form.

No not necessary, I'll get rid of it.

/ Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ