[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <7dcef766-2307-c639-4c4c-74df2afd2910@cumulusnetworks.com>
Date: Fri, 5 Apr 2019 15:59:03 +0300
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Roopa Prabhu <roopa@...ulusnetworks.com>,
David Ahern <dsa@...ulusnetworks.com>,
network dev <netdev@...r.kernel.org>
Subject: bridge mdb json output broken/invalid
Hi Stephen,
It seems that commit c7c1a1ef51aea ("bridge: colorize output and use JSON print library") broke
bridge mdb's json output. The json after that commit is invalid, more below.
Setup: 2 bridges - virbr0 and br-test
non-json bridge mdb show:
3: virbr0 vnet3 239.10.10.50 temp
3: virbr0 vnet3 225.1.2.3 temp
14: br-test v1 224.224.224.224 permanent
json bridge -d -p -j mdb show before c7c1a1ef51aea:
{
"mdb": [ {
"dev": "virbr0",
"port": "vnet3",
"grp": "239.10.10.50",
"state": "temp"
},{
"dev": "virbr0",
"port": "vnet3",
"grp": "225.1.2.3",
"state": "temp"
},{
"dev": "br-test",
"port": "v1",
"grp": "224.224.224.224",
"state": "permanent"
} ],
"router": {
"virbr0": [ {
"port": "vnet3"
} ],
"br-test": [ {
"port": "v1"
} ]
}
}
json bridge -d -p -j mdb show after c7c1a1ef51aea:
[
"mdb": [ {
"index": 3,
"dev": "virbr0",
"port": "vnet3",
"grp": "239.10.10.50",
"state": "temp",
"flags": [ ]
},{
"index": 3,
"dev": "virbr0",
"port": "vnet3",
"grp": "225.1.2.3",
"state": "temp",
"flags": [ ]
} ],
"router": [
"virbr0": [ {
"port": "vnet3"
} ] ],
"mdb": [ ],
"mdb": [ {
"index": 14,
"dev": "br-test",
"port": "v1",
"grp": "224.224.224.224",
"state": "permanent",
"flags": [ ]
} ],
"router": [
"br-test": [ {
"port": "v1"
} ] ] ]
Obviously this is not a valid object array and even if it was converted, it must not contain
duplicate entries. The "mdb" and "router" array entries must be unique and should contain
all the single entries inside, also the global context shouldn't be array.
Cheers,
Nik
Powered by blists - more mailing lists