]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: dump vlan table information for link
authorRoman Mashak <mrv@mojatatu.com>
Fri, 8 Sep 2017 21:52:22 +0000 (17:52 -0400)
committerStephen Hemminger <sthemmin@microsoft.com>
Thu, 26 Oct 2017 10:35:04 +0000 (12:35 +0200)
Kernel also reports vlans a port is member of, so print it. Since vlan
table can be quite large, dump it only when detailed information is
requested.

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
bridge/link.c

index 93472ad3699e39bb4175d96c74993981b7df7e6c..60200f160622a7e3a3c0e17f9426b4be96e1fd60 100644 (file)
@@ -213,6 +213,13 @@ int print_linkinfo(const struct sockaddr_nl *who,
 
                if (aftb[IFLA_BRIDGE_MODE])
                        print_hwmode(fp, rta_getattr_u16(aftb[IFLA_BRIDGE_MODE]));
+               if (show_details) {
+                       if (aftb[IFLA_BRIDGE_VLAN_INFO]) {
+                               fprintf(fp, "\n");
+                               print_vlan_info(fp, tb[IFLA_AF_SPEC],
+                                               ifi->ifi_index);
+                       }
+               }
        }
 
        fprintf(fp, "\n");