aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q')
-rw-r--r--net/8021q/vlan_dev.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 8efa399823e3..9efd3c67c1db 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -518,19 +518,35 @@ static int vlan_dev_open(struct net_device *dev)
518 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) { 518 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) {
519 err = dev_unicast_add(real_dev, dev->dev_addr, ETH_ALEN); 519 err = dev_unicast_add(real_dev, dev->dev_addr, ETH_ALEN);
520 if (err < 0) 520 if (err < 0)
521 return err; 521 goto out;
522 } 522 }
523 memcpy(vlan->real_dev_addr, real_dev->dev_addr, ETH_ALEN);
524 523
525 if (dev->flags & IFF_ALLMULTI) 524 if (dev->flags & IFF_ALLMULTI) {
526 dev_set_allmulti(real_dev, 1); 525 err = dev_set_allmulti(real_dev, 1);
527 if (dev->flags & IFF_PROMISC) 526 if (err < 0)
528 dev_set_promiscuity(real_dev, 1); 527 goto del_unicast;
528 }
529 if (dev->flags & IFF_PROMISC) {
530 err = dev_set_promiscuity(real_dev, 1);
531 if (err < 0)
532 goto clear_allmulti;
533 }
534
535 memcpy(vlan->real_dev_addr, real_dev->dev_addr, ETH_ALEN);
529 536
530 if (vlan->flags & VLAN_FLAG_GVRP) 537 if (vlan->flags & VLAN_FLAG_GVRP)
531 vlan_gvrp_request_join(dev); 538 vlan_gvrp_request_join(dev);
532 539
533 return 0; 540 return 0;
541
542clear_allmulti:
543 if (dev->flags & IFF_ALLMULTI)
544 dev_set_allmulti(real_dev, -1);
545del_unicast:
546 if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr))
547 dev_unicast_delete(real_dev, dev->dev_addr, ETH_ALEN);
548out:
549 return err;
534} 550}
535 551
536static int vlan_dev_stop(struct net_device *dev) 552static int vlan_dev_stop(struct net_device *dev)