diff options
author | Ido Schimmel <idosch@mellanox.com> | 2018-11-28 21:06:58 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-01 02:06:28 +0100 |
commit | 5a6db04ca8d44c873d6dd6bc3d2328aaa4c86a87 (patch) | |
tree | 263cf8f434480df60eb357309a99a7950a0e7a9a /net/bridge/br_vlan.c | |
parent | Merge branch 'qed-Doorbell-overflow-recovery' (diff) | |
download | linux-5a6db04ca8d44c873d6dd6bc3d2328aaa4c86a87.tar.xz linux-5a6db04ca8d44c873d6dd6bc3d2328aaa4c86a87.zip |
net: bridge: Extend br_vlan_get_pvid() for bridge ports
Currently, the function only works for the bridge device itself, but
subsequent patches will need to be able to query the PVID of a given
bridge port, so extend the function.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_vlan.c')
-rw-r--r-- | net/bridge/br_vlan.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index b21838b51220..48f50d7ac624 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -1217,9 +1217,13 @@ void br_vlan_get_stats(const struct net_bridge_vlan *v, int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid) { struct net_bridge_vlan_group *vg; + struct net_bridge_port *p; ASSERT_RTNL(); - if (netif_is_bridge_master(dev)) + p = br_port_get_check_rtnl(dev); + if (p) + vg = nbp_vlan_group(p); + else if (netif_is_bridge_master(dev)) vg = br_vlan_group(netdev_priv(dev)); else return -EINVAL; |