]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: dsa: b53: Ensure the default VID is untagged
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 14 Feb 2020 23:26:19 +0000 (15:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:00 +0000 (16:45 +0100)
[ Upstream commit d965a5432d4c3e6b9c3d2bc1d4a800013bbf76f6 ]

We need to ensure that the default VID is untagged otherwise the switch
will be sending tagged frames and the results can be problematic. This
is especially true with b53 switches that use VID 0 as their default
VLAN since VID 0 has a special meaning.

Fixes: fea83353177a ("net: dsa: b53: Fix default VLAN ID")
Fixes: 061f6a505ac3 ("net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/b53/b53_common.c

index 6a1ff4d43e3a6f8628c67c3d62d1c9fbd88ec4f7..38b16efda4a9f4865bfb3dc76638fff8b759a0ac 100644 (file)
@@ -1353,6 +1353,9 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
 
                b53_get_vlan_entry(dev, vid, vl);
 
+               if (vid == 0 && vid == b53_default_pvid(dev))
+                       untagged = true;
+
                vl->members |= BIT(port);
                if (untagged && !dsa_is_cpu_port(ds, port))
                        vl->untag |= BIT(port);