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]
Message-ID: <Zvqrb3HYM3XogzOn@shredder.mtl.com>
Date: Mon, 30 Sep 2024 16:45:19 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Guillaume Nault <gnault@...hat.com>, dsahern@...nel.org
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
	pabeni@...hat.com, edumazet@...gle.com
Subject: Re: [PATCH net-next 0/6] net: fib_rules: Add DSCP selector support

Hi Guillaume,

Sorry for the delay. Was OOO / sick. Thanks for reviewing the patches.

On Fri, Sep 13, 2024 at 03:08:36PM +0200, Guillaume Nault wrote:
> On Wed, Sep 11, 2024 at 12:37:42PM +0300, Ido Schimmel wrote:
[...]
> > iproute2 changes can be found here [1].
> > 
> > [1] https://github.com/idosch/iproute2/tree/submit/dscp_rfc_v1
> 
> Any reason for always printing numbers in the json output of this
> iproute2 RFC? Why can't json users just use the -N parameter?

Because then the JSON output is always printed as a string. Example with
the old "tos" keyword:

# ip -6 rule add tos CS1 table 100
# ip -6 -j -p rule show tos CS1          
[ {
        "priority": 32765,
        "src": "all",
        "tos": "CS1",
        "table": "100"
    } ]
# ip -6 -j -p -N rule show tos CS1
[ {
        "priority": 32765,
        "src": "all",
        "tos": "0x20",
        "table": "100"
    } ]

Plus, JSON output should be consumed by scripts and it doesn't make
sense to me to use symbolic names there.

> I haven't checked all the /etc/iproute2/rt_* aliases, but the general
> behaviour seems to print the human readable name for both json and
> normal outputs, unles -N is given on the command line.

dcb is also always using numeric output for JSON:

# dcb app add dev swp1 dscp-prio CS1:0 CS2:1
# dcb -j -p app show dev swp1 dscp-prio
{
    "dscp_prio": [ [ 8,0," " ],[ 16,1," " ] ]
}
# dcb -j -p -N app show dev swp1 dscp-prio
{
    "dscp_prio": [ [ 8,0," " ],[ 16,1," " ] ]
}

So there is already inconsistency in iproute2. I chose the approach that
seemed correct to me. I don't think much thought went into always
printing strings in JSON output other than that it was easy to
implement.

David, what is your preference?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ