Skip to content

Commit 5745918

Browse files
Jiri Pirkodavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 348a144 commit 5745918

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/net/team/team.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
588588
goto err_dev_open;
589589
}
590590

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+
591598
err = netdev_set_master(port_dev, dev);
592599
if (err) {
593600
netdev_err(dev, "Device %s failed to set master\n", portname);
@@ -615,6 +622,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
615622
netdev_set_master(port_dev, NULL);
616623

617624
err_set_master:
625+
vlan_vids_del_by_dev(port_dev, dev);
626+
627+
err_vids_add:
618628
dev_close(port_dev);
619629

620630
err_dev_open:
@@ -648,6 +658,7 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
648658
team_adjust_ops(team);
649659
netdev_rx_handler_unregister(port_dev);
650660
netdev_set_master(port_dev, NULL);
661+
vlan_vids_del_by_dev(port_dev, dev);
651662
dev_close(port_dev);
652663
team_port_leave(team, port);
653664
team_port_set_orig_mac(port);

0 commit comments

Comments
 (0)