Skip to content

Commit b599c79

Browse files
committed
team: Fix feature exposure when no ports are present
jira LE-2974 Rebuild_History Non-Buildable kernel-5.14.0-503.40.1.el9_5 commit-author Daniel Borkmann <[email protected]> commit e78c20f Small follow-up to align this to an equivalent behavior as the bond driver. The change in 3625920 ("teaming: fix vlan_features computing") removed the netdevice vlan_features when there is no team port attached, yet it leaves the full set of enc_features intact. Instead, leave the default features as pre 3625920, and recompute once we do have ports attached. Also, similarly as in bonding case, call the netdev_base_features() helper on the enc_features. Fixes: 3625920 ("teaming: fix vlan_features computing") Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit e78c20f) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 0c5cf11 commit b599c79

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/team/team_core.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -999,9 +999,13 @@ static void __team_compute_features(struct team *team)
999999
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
10001000
IFF_XMIT_DST_RELEASE_PERM;
10011001

1002+
rcu_read_lock();
1003+
if (list_empty(&team->port_list))
1004+
goto done;
1005+
10021006
vlan_features = netdev_base_features(vlan_features);
1007+
enc_features = netdev_base_features(enc_features);
10031008

1004-
rcu_read_lock();
10051009
list_for_each_entry_rcu(port, &team->port_list, list) {
10061010
vlan_features = netdev_increment_features(vlan_features,
10071011
port->dev->vlan_features,
@@ -1011,11 +1015,11 @@ static void __team_compute_features(struct team *team)
10111015
port->dev->hw_enc_features,
10121016
TEAM_ENC_FEATURES);
10131017

1014-
10151018
dst_release_flag &= port->dev->priv_flags;
10161019
if (port->dev->hard_header_len > max_hard_header_len)
10171020
max_hard_header_len = port->dev->hard_header_len;
10181021
}
1022+
done:
10191023
rcu_read_unlock();
10201024

10211025
team->dev->vlan_features = vlan_features;

0 commit comments

Comments
 (0)