Skip to content

Commit

Permalink
net: bridge: Extend br_vlan_get_pvid() for bridge ports
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Dec 1, 2018
1 parent 734317d commit 5a6db04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/bridge/br_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5a6db04

Please sign in to comment.