Skip to content

Commit 2ea7a67

Browse files
lunndavem330
authored andcommitted
net: dsa: Don't add vlans when vlan filtering is disabled
The software bridge can be build with vlan filtering support included. However, by default it is turned off. In its turned off state, it still passes VLANs via switchev, even though they are not to be used. Don't pass these VLANs to the hardware. Only do so when vlan filtering is enabled. This fixes at least one corner case. There are still issues in other corners, such as when vlan_filtering is later enabled. Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4fdc302 commit 2ea7a67

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

net/dsa/port.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ int dsa_port_vlan_add(struct dsa_port *dp,
252252
.vlan = vlan,
253253
};
254254

255-
return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_ADD, &info);
255+
if (br_vlan_enabled(dp->bridge_dev))
256+
return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_ADD, &info);
257+
258+
return 0;
256259
}
257260

258261
int dsa_port_vlan_del(struct dsa_port *dp,
@@ -264,7 +267,10 @@ int dsa_port_vlan_del(struct dsa_port *dp,
264267
.vlan = vlan,
265268
};
266269

267-
return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_DEL, &info);
270+
if (br_vlan_enabled(dp->bridge_dev))
271+
return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_DEL, &info);
272+
273+
return 0;
268274
}
269275

270276
int dsa_port_fixed_link_register_of(struct dsa_port *dp)

0 commit comments

Comments
 (0)