net/8021q: Implement Multiple VLAN Registration Protocol (MVRP)
Initial implementation of the Multiple VLAN Registration Protocol (MVRP) from IEEE 802.1Q-2011, based on the existing implementation of the GARP VLAN Registration Protocol (GVRP). Signed-off-by: David Ward <david.ward@ll.mit.edu> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
febf018d22
commit
86fbe9bb59
@@ -261,7 +261,7 @@ int vlan_dev_change_flags(const struct net_device *dev, u32 flags, u32 mask)
|
||||
u32 old_flags = vlan->flags;
|
||||
|
||||
if (mask & ~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP |
|
||||
VLAN_FLAG_LOOSE_BINDING))
|
||||
VLAN_FLAG_LOOSE_BINDING | VLAN_FLAG_MVRP))
|
||||
return -EINVAL;
|
||||
|
||||
vlan->flags = (old_flags & ~mask) | (flags & mask);
|
||||
@@ -272,6 +272,13 @@ int vlan_dev_change_flags(const struct net_device *dev, u32 flags, u32 mask)
|
||||
else
|
||||
vlan_gvrp_request_leave(dev);
|
||||
}
|
||||
|
||||
if (netif_running(dev) && (vlan->flags ^ old_flags) & VLAN_FLAG_MVRP) {
|
||||
if (vlan->flags & VLAN_FLAG_MVRP)
|
||||
vlan_mvrp_request_join(dev);
|
||||
else
|
||||
vlan_mvrp_request_leave(dev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -312,6 +319,9 @@ static int vlan_dev_open(struct net_device *dev)
|
||||
if (vlan->flags & VLAN_FLAG_GVRP)
|
||||
vlan_gvrp_request_join(dev);
|
||||
|
||||
if (vlan->flags & VLAN_FLAG_MVRP)
|
||||
vlan_mvrp_request_join(dev);
|
||||
|
||||
if (netif_carrier_ok(real_dev))
|
||||
netif_carrier_on(dev);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user