]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: vni: Indent statistics with 2 spaces
authorBenjamin Poirier <bpoirier@nvidia.com>
Mon, 11 Dec 2023 14:07:28 +0000 (09:07 -0500)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 22 Dec 2023 17:54:23 +0000 (09:54 -0800)
`bridge -s vlan` indents statistics with 2 spaces compared to the vlan id
column while `bridge -s vni` indents them with 1 space. Change `bridge vni`
to match the behavior of `bridge vlan` since that second command predates
`bridge vni`.

Before:
$ bridge -s vni
dev               vni                group/remote
vxlan1            4001
                   RX: bytes 0 pkts 0 drops 0 errors 0
                   TX: bytes 0 pkts 0 drops 0 errors 0
                  4002               10.0.0.1
                   RX: bytes 0 pkts 0 drops 0 errors 0
                   TX: bytes 0 pkts 0 drops 0 errors 0
vxlan2            100
                   RX: bytes 0 pkts 0 drops 0 errors 0
                   TX: bytes 0 pkts 0 drops 0 errors 0

After:
$ bridge -s vni
dev               vni                group/remote
vxlan1            4001
                    RX: bytes 0 pkts 0 drops 0 errors 0
                    TX: bytes 0 pkts 0 drops 0 errors 0
                  4002               10.0.0.1
                    RX: bytes 0 pkts 0 drops 0 errors 0
                    TX: bytes 0 pkts 0 drops 0 errors 0
vxlan2            100
                    RX: bytes 0 pkts 0 drops 0 errors 0
                    TX: bytes 0 pkts 0 drops 0 errors 0

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vni.c

index e9943872b6231de38018073c0df21d4c12243a1a..2c6d506a72de5f09822f851622c3430b7d98739f 100644 (file)
@@ -187,8 +187,8 @@ static void print_vnifilter_entry_stats(struct rtattr *stats_attr)
                           RTA_PAYLOAD(stats_attr), NLA_F_NESTED);
 
        print_nl();
-       print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s   ", "");
-       print_string(PRINT_FP, NULL, "RX: ", "");
+       print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s    RX: ",
+                    "");
 
        if (stb[VNIFILTER_ENTRY_STATS_RX_BYTES]) {
                stat = rta_getattr_u64(stb[VNIFILTER_ENTRY_STATS_RX_BYTES]);
@@ -208,8 +208,8 @@ static void print_vnifilter_entry_stats(struct rtattr *stats_attr)
        }
 
        print_nl();
-       print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s   ", "");
-       print_string(PRINT_FP, NULL, "TX: ", "");
+       print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s    TX: ",
+                    "");
 
        if (stb[VNIFILTER_ENTRY_STATS_TX_BYTES]) {
                stat = rta_getattr_u64(stb[VNIFILTER_ENTRY_STATS_TX_BYTES]);