]> git.ipfire.org Git - thirdparty/iproute2.git/commit
bridge: fdb show: fix fdb entry state output for json context
authorJulien Fortin <julien@cumulusnetworks.com>
Wed, 29 Jul 2020 13:04:25 +0000 (15:04 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 30 Jul 2020 01:08:46 +0000 (18:08 -0700)
commitcb17e0cc578162a33d62afcbf9df471183a6b0c7
tree9daab63362ced0fdddf3d9423973ae2b36695b9b
parent65c0c4d21b9610acdaced7f3ce256d265651b47d
bridge: fdb show: fix fdb entry state output for json context

bridge json fdb show is printing an incorrect / non-machine readable
value, when using -j (json output) we are expecting machine readable
data that shouldn't require special handling/parsing.

$ bridge -j fdb show | \
python -c \
'import sys,json;print(json.dumps(json.loads(sys.stdin.read()),indent=4))'
[
    {
"master": "br0",
"mac": "56:23:28:4f:4f:e5",
"flags": [],
"ifname": "vx0",
"state": "state=0x80"  <<<<<<<<< with the patch: "state": "0x80"
    }
]

Fixes: c7c1a1ef51aea7c ("bridge: colorize output and use JSON print library")
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/fdb.c