summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZiyang Xuan <william.xuanziyang@huawei.com>2023-08-14 11:23:01 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-30 16:35:12 +0200
commit405ce10bfef8f5a82f5f1fe4b2d10749d4612b64 (patch)
tree95b7e34241c9869bab6071ec3db1420881a141cd
parentc6c910477ec6c7009dee3908f58b348d7f7fcec3 (diff)
downloadlinux-405ce10bfef8f5a82f5f1fe4b2d10749d4612b64.tar.gz
linux-405ce10bfef8f5a82f5f1fe4b2d10749d4612b64.tar.bz2
linux-405ce10bfef8f5a82f5f1fe4b2d10749d4612b64.zip
team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
[ Upstream commit dafcbce07136d799edc4c67f04f9fd69ff1eac1f ] Similar to commit 01f4fd270870 ("bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves"), we can trigger BUG_ON(!vlan_info) in unregister_vlan_dev() with the following testcase: # ip netns add ns1 # ip netns exec ns1 ip link add team1 type team # ip netns exec ns1 ip link add team_slave type veth peer veth2 # ip netns exec ns1 ip link set team_slave master team1 # ip netns exec ns1 ip link add link team_slave name team_slave.10 type vlan id 10 protocol 802.1ad # ip netns exec ns1 ip link add link team1 name team1.10 type vlan id 10 protocol 802.1ad # ip netns exec ns1 ip link set team_slave nomaster # ip netns del ns1 Add S-VLAN tag related features support to team driver. So the team driver will always propagate the VLAN info to its slaves. Fixes: 8ad227ff89a7 ("net: vlan: add 802.1ad support") Suggested-by: Ido Schimmel <idosch@idosch.org> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230814032301.2804971-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/team/team.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index b318464a4fca..7b6cae28f6d3 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2160,7 +2160,9 @@ static void team_setup(struct net_device *dev)
dev->hw_features = TEAM_VLAN_FEATURES |
NETIF_F_HW_VLAN_CTAG_RX |
- NETIF_F_HW_VLAN_CTAG_FILTER;
+ NETIF_F_HW_VLAN_CTAG_FILTER |
+ NETIF_F_HW_VLAN_STAG_RX |
+ NETIF_F_HW_VLAN_STAG_FILTER;
dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
dev->features |= dev->hw_features;