Skip to content

Commit 72f4af4

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c80fafb commit 72f4af4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/bridge/br_netlink.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,9 @@ static int br_fill_linkxstats(struct sk_buff *skb,
13131313
return -EMSGSIZE;
13141314

13151315
if (vg) {
1316+
u16 pvid;
1317+
1318+
pvid = br_get_pvid(vg);
13161319
list_for_each_entry(v, &vg->vlan_list, vlist) {
13171320
struct bridge_vlan_xstats vxi;
13181321
struct br_vlan_stats stats;
@@ -1322,6 +1325,8 @@ static int br_fill_linkxstats(struct sk_buff *skb,
13221325
memset(&vxi, 0, sizeof(vxi));
13231326
vxi.vid = v->vid;
13241327
vxi.flags = v->flags;
1328+
if (v->vid == pvid)
1329+
vxi.flags |= BRIDGE_VLAN_INFO_PVID;
13251330
br_vlan_get_stats(v, &stats);
13261331
vxi.rx_bytes = stats.rx_bytes;
13271332
vxi.rx_packets = stats.rx_packets;

0 commit comments

Comments
 (0)