From 145746765f06a3dbc7869c81d0165b3ab96f935a Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Sun, 28 Apr 2019 21:45:48 +0300 Subject: net: dsa: Keep the vlan_filtering setting in dsa_switch if it's global The current behavior is not as obvious as one would assume (which is that, if the driver set vlan_filtering_is_global = 1, then checking any dp->vlan_filtering would yield the same result). Only the ports which are actively enslaved into a bridge would have vlan_filtering set. This makes it tricky for drivers to check what the global state is. So fix this and make the struct dsa_switch hold this global setting. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller --- net/dsa/port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'net/dsa') diff --git a/net/dsa/port.c b/net/dsa/port.c index 9a6ed138878c..c27c16b69ab6 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -208,7 +208,10 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering, if (err) return err; - dp->vlan_filtering = vlan_filtering; + if (ds->vlan_filtering_is_global) + ds->vlan_filtering = vlan_filtering; + else + dp->vlan_filtering = vlan_filtering; return 0; } -- cgit