Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: bridge: export also pvid flag in the xstats flags

When I added support to export the vlan entry flags via xstats I forgot to
add support for the pvid since it is manually matched, so check if the
entry matches the vlan_group's pvid and set the flag appropriately.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nikolay Aleksandrov and committed by
David S. Miller
72f4af4e c80fafbb

+5
+5
net/bridge/br_netlink.c
··· 1313 1313 return -EMSGSIZE; 1314 1314 1315 1315 if (vg) { 1316 + u16 pvid; 1317 + 1318 + pvid = br_get_pvid(vg); 1316 1319 list_for_each_entry(v, &vg->vlan_list, vlist) { 1317 1320 struct bridge_vlan_xstats vxi; 1318 1321 struct br_vlan_stats stats; ··· 1325 1322 memset(&vxi, 0, sizeof(vxi)); 1326 1323 vxi.vid = v->vid; 1327 1324 vxi.flags = v->flags; 1325 + if (v->vid == pvid) 1326 + vxi.flags |= BRIDGE_VLAN_INFO_PVID; 1328 1327 br_vlan_get_stats(v, &stats); 1329 1328 vxi.rx_bytes = stats.rx_bytes; 1330 1329 vxi.rx_packets = stats.rx_packets;