diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-12-07 23:11:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-08 19:52:43 -0500 |
commit | 57459185a19b0246866479522b77cbb9732201d1 (patch) | |
tree | 75a0d4ea2b0024428f5f519ab16a5b537d482e62 /drivers/net/team | |
parent | 348a1443cc4303c72cf1ee3b26e476fec8e7b5fa (diff) |
team: use vlan_vids_[addr/del]_by_dev
So far when vlan id was added to team device befor port was added, this
vid was not added to port's vlan filter. Also after removal, vid stayed
in port device's vlan filter. Benefit of new vlan functions to handle
this work.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team')
-rw-r--r-- | drivers/net/team/team.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 79c2d1b52eb..ed2a862b835 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -588,6 +588,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev) | |||
588 | goto err_dev_open; | 588 | goto err_dev_open; |
589 | } | 589 | } |
590 | 590 | ||
591 | err = vlan_vids_add_by_dev(port_dev, dev); | ||
592 | if (err) { | ||
593 | netdev_err(dev, "Failed to add vlan ids to device %s\n", | ||
594 | portname); | ||
595 | goto err_vids_add; | ||
596 | } | ||
597 | |||
591 | err = netdev_set_master(port_dev, dev); | 598 | err = netdev_set_master(port_dev, dev); |
592 | if (err) { | 599 | if (err) { |
593 | netdev_err(dev, "Device %s failed to set master\n", portname); | 600 | netdev_err(dev, "Device %s failed to set master\n", portname); |
@@ -615,6 +622,9 @@ err_handler_register: | |||
615 | netdev_set_master(port_dev, NULL); | 622 | netdev_set_master(port_dev, NULL); |
616 | 623 | ||
617 | err_set_master: | 624 | err_set_master: |
625 | vlan_vids_del_by_dev(port_dev, dev); | ||
626 | |||
627 | err_vids_add: | ||
618 | dev_close(port_dev); | 628 | dev_close(port_dev); |
619 | 629 | ||
620 | err_dev_open: | 630 | err_dev_open: |
@@ -648,6 +658,7 @@ static int team_port_del(struct team *team, struct net_device *port_dev) | |||
648 | team_adjust_ops(team); | 658 | team_adjust_ops(team); |
649 | netdev_rx_handler_unregister(port_dev); | 659 | netdev_rx_handler_unregister(port_dev); |
650 | netdev_set_master(port_dev, NULL); | 660 | netdev_set_master(port_dev, NULL); |
661 | vlan_vids_del_by_dev(port_dev, dev); | ||
651 | dev_close(port_dev); | 662 | dev_close(port_dev); |
652 | team_port_leave(team, port); | 663 | team_port_leave(team, port); |
653 | team_port_set_orig_mac(port); | 664 | team_port_set_orig_mac(port); |