diff options
author | Vladimir Oltean | 2020-09-21 03:10:28 +0300 |
---|---|---|
committer | David S. Miller | 2020-09-20 19:01:34 -0700 |
commit | adb256eb1769dec74b809690f418e8e46bee62a7 (patch) | |
tree | f362224553c614ba86a55df3f0ae349fc569390b /net/dsa/slave.c | |
parent | 707ec383b369b8da9f009c3ab2236b335ec10788 (diff) |
net: dsa: allow 8021q uppers while the bridge has vlan_filtering=0
When the bridge has VLAN awareness disabled there isn't any duplication
of functionality, since the bridge does not process VLAN. Don't deny
adding 8021q uppers to DSA switch ports in that case. The switch is
supposed to simply pass traffic leaving the VLAN tag as-is, and the
stack will happily strip the VLAN tag for all 8021q uppers that exist.
We need to ensure that there are no 8021q uppers when the user attempts
to enable bridge vlan_filtering.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 89f03fde760e..ad5732c1a4b0 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -344,7 +344,7 @@ static int dsa_slave_vlan_add(struct net_device *dev, /* Deny adding a bridge VLAN when there is already an 802.1Q upper with * the same VID. */ - if (trans->ph_prepare) { + if (trans->ph_prepare && br_vlan_enabled(dp->bridge_dev)) { rcu_read_lock(); err = dsa_slave_vlan_check_for_8021q_uppers(dev, &vlan); rcu_read_unlock(); @@ -1936,7 +1936,7 @@ dsa_slave_check_8021q_upper(struct net_device *dev, int err = NOTIFY_DONE; u16 vid; - if (!br) + if (!br || !br_vlan_enabled(br)) return NOTIFY_DONE; extack = netdev_notifier_info_to_extack(&info->info); |