]> git.ipfire.org Git - thirdparty/iproute2.git/commit
bridge: vlan: fix standard stats output
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 16 Apr 2019 15:30:12 +0000 (18:30 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 17 Apr 2019 23:30:05 +0000 (16:30 -0700)
commit6e982e7b9ba2a7810aeb67232bdc4697cc5721ea
tree14f908a02172afafec6e3662b38bc87b462be795
parentb11b495e7c071691e6282d048ab2d1a32a8c000d
bridge: vlan: fix standard stats output

Each of the commits below broke the vlan stats output in a different
way:
45fca4ed9412 ("bridge: fix vlan show stats formatting")
 Added a second print of an interface name (e.g. eth4eth4)
c7c1a1ef51ae ("bridge: colorize output and use JSON print library")
 Broke normal vlan stats output by not printing a new line after them
 Also printed interfaces without any vlans when printing stats

This fix is not pretty but it brings back the previous behaviour.

Before this fix:
$ bridge -s vlan show
port             vlan id
br0br0              1 PVID Egress Untagged
                   RX: 0 bytes 0 packets
                   TX: 0 bytes 0 packets 4
                   RX: 0 bytes 0 packets
                   TX: 0 bytes 0 packetseth4eth4             4
                   RX: 0 bytes 0 packets
                   TX: 0 bytes 0 packetsroot@debian:~/

After this fix:
$ bridge -s vlan show
port             vlan id
br0              1 PVID Egress Untagged
                   RX: 0 bytes 0 packets
                   TX: 0 bytes 0 packets
                 4
                   RX: 0 bytes 0 packets
                   TX: 0 bytes 0 packets
eth4             4
                   RX: 0 bytes 0 packets
                   TX: 0 bytes 0 packets

Fixes: 45fca4ed9412 ("bridge: fix vlan show stats formatting")
Fixes: c7c1a1ef51ae ("bridge: colorize output and use JSON print library")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vlan.c