diff options
author | David Ward <david.ward@ll.mit.edu> | 2013-02-08 12:17:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-10 20:37:22 -0500 |
commit | 86fbe9bb599fcaf7e92e38dbfdad0414a2d68f7d (patch) | |
tree | 2e8b109de2f0e3b5c1b59f8dd2737388109ef982 /net/8021q/vlan_dev.c | |
parent | febf018d22347b5df94066bca05d0c11a84e839d (diff) |
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>
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r-- | net/8021q/vlan_dev.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 09f9108d4688..34df5b3c9b75 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -261,7 +261,7 @@ int vlan_dev_change_flags(const struct net_device *dev, u32 flags, u32 mask) | |||
261 | u32 old_flags = vlan->flags; | 261 | u32 old_flags = vlan->flags; |
262 | 262 | ||
263 | if (mask & ~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP | | 263 | if (mask & ~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP | |
264 | VLAN_FLAG_LOOSE_BINDING)) | 264 | VLAN_FLAG_LOOSE_BINDING | VLAN_FLAG_MVRP)) |
265 | return -EINVAL; | 265 | return -EINVAL; |
266 | 266 | ||
267 | vlan->flags = (old_flags & ~mask) | (flags & mask); | 267 | 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) | |||
272 | else | 272 | else |
273 | vlan_gvrp_request_leave(dev); | 273 | vlan_gvrp_request_leave(dev); |
274 | } | 274 | } |
275 | |||
276 | if (netif_running(dev) && (vlan->flags ^ old_flags) & VLAN_FLAG_MVRP) { | ||
277 | if (vlan->flags & VLAN_FLAG_MVRP) | ||
278 | vlan_mvrp_request_join(dev); | ||
279 | else | ||
280 | vlan_mvrp_request_leave(dev); | ||
281 | } | ||
275 | return 0; | 282 | return 0; |
276 | } | 283 | } |
277 | 284 | ||
@@ -312,6 +319,9 @@ static int vlan_dev_open(struct net_device *dev) | |||
312 | if (vlan->flags & VLAN_FLAG_GVRP) | 319 | if (vlan->flags & VLAN_FLAG_GVRP) |
313 | vlan_gvrp_request_join(dev); | 320 | vlan_gvrp_request_join(dev); |
314 | 321 | ||
322 | if (vlan->flags & VLAN_FLAG_MVRP) | ||
323 | vlan_mvrp_request_join(dev); | ||
324 | |||
315 | if (netif_carrier_ok(real_dev)) | 325 | if (netif_carrier_ok(real_dev)) |
316 | netif_carrier_on(dev); | 326 | netif_carrier_on(dev); |
317 | return 0; | 327 | return 0; |