Skip to content

Commit 49a2f5c

Browse files
committed
Merge branch 'fix-2-dsa-issues-with-vlan_filtering_is_global'
Vladimir Oltean says: ==================== Fix 2 DSA issues with vlan_filtering_is_global This patch set fixes 2 issues with vlan_filtering_is_global switches. Both are regressions introduced by refactoring commit d0004a0 ("net: dsa: remove the "dsa_to_port in a loop" antipattern from the core"), which wasn't tested on a wide enough variety of switches. Tested on the sja1105 driver. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 1e53834 + 1699b4d commit 49a2f5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/dsa/port.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ static void dsa_port_reset_vlan_filtering(struct dsa_port *dp,
248248
struct netlink_ext_ack extack = {0};
249249
bool change_vlan_filtering = false;
250250
struct dsa_switch *ds = dp->ds;
251+
struct dsa_port *other_dp;
251252
bool vlan_filtering;
252253
int err;
253254

@@ -270,8 +271,8 @@ static void dsa_port_reset_vlan_filtering(struct dsa_port *dp,
270271
* VLAN-aware bridge.
271272
*/
272273
if (change_vlan_filtering && ds->vlan_filtering_is_global) {
273-
dsa_switch_for_each_port(dp, ds) {
274-
struct net_device *br = dsa_port_bridge_dev_get(dp);
274+
dsa_switch_for_each_port(other_dp, ds) {
275+
struct net_device *br = dsa_port_bridge_dev_get(other_dp);
275276

276277
if (br && br_vlan_enabled(br)) {
277278
change_vlan_filtering = false;
@@ -799,7 +800,7 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
799800
ds->vlan_filtering = vlan_filtering;
800801

801802
dsa_switch_for_each_user_port(other_dp, ds) {
802-
struct net_device *slave = dp->slave;
803+
struct net_device *slave = other_dp->slave;
803804

804805
/* We might be called in the unbind path, so not
805806
* all slave devices might still be registered.

0 commit comments

Comments
 (0)