summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2017-11-06 18:04:24 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-10 00:28:13 -0500
commit2ea7a679ca2abd251c1ec03f20508619707e1749 (patch)
treed7f2e26bd8ac44cec8443de0beec7d6932da8e64
parent4fdc3023c67c1c951d0b5594f37a2066d5191bdc (diff)
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 <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/dsa/port.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c
index a85cd63a91c4..bb4be2679904 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -252,7 +252,10 @@ int dsa_port_vlan_add(struct dsa_port *dp,
252 .vlan = vlan, 252 .vlan = vlan,
253 }; 253 };
254 254
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;
256} 259}
257 260
258int dsa_port_vlan_del(struct dsa_port *dp, 261int dsa_port_vlan_del(struct dsa_port *dp,
@@ -264,7 +267,10 @@ int dsa_port_vlan_del(struct dsa_port *dp,
264 .vlan = vlan, 267 .vlan = vlan,
265 }; 268 };
266 269
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;
268} 274}
269 275
270int dsa_port_fixed_link_register_of(struct dsa_port *dp) 276int dsa_port_fixed_link_register_of(struct dsa_port *dp)