Skip to content

Commit

Permalink
net: bridge: export also pvid flag in the xstats flags
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Aug 26, 2016
1 parent c80fafb commit 72f4af4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,9 @@ static int br_fill_linkxstats(struct sk_buff *skb,
return -EMSGSIZE;

if (vg) {
u16 pvid;

pvid = br_get_pvid(vg);
list_for_each_entry(v, &vg->vlan_list, vlist) {
struct bridge_vlan_xstats vxi;
struct br_vlan_stats stats;
Expand All @@ -1322,6 +1325,8 @@ static int br_fill_linkxstats(struct sk_buff *skb,
memset(&vxi, 0, sizeof(vxi));
vxi.vid = v->vid;
vxi.flags = v->flags;
if (v->vid == pvid)
vxi.flags |= BRIDGE_VLAN_INFO_PVID;
br_vlan_get_stats(v, &stats);
vxi.rx_bytes = stats.rx_bytes;
vxi.rx_packets = stats.rx_packets;
Expand Down

0 comments on commit 72f4af4

Please sign in to comment.