]> Pileus Git - ~andy/linux/blobdiff - net/bridge/br_vlan.c
bridge: Fix inabillity to retrieve vlan tags when tx offload is disabled
[~andy/linux] / net / bridge / br_vlan.c
index 8249ca764c79c5f2ddab51006ad445752b3ac137..44f31af0b965d6365d748d45951f9ad8bb9714c7 100644 (file)
@@ -174,6 +174,18 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
        if (!v)
                return false;
 
+       /* If vlan tx offload is disabled on bridge device and frame was
+        * sent from vlan device on the bridge device, it does not have
+        * HW accelerated vlan tag.
+        */
+       if (unlikely(!vlan_tx_tag_present(skb) &&
+                    (skb->protocol == htons(ETH_P_8021Q) ||
+                     skb->protocol == htons(ETH_P_8021AD)))) {
+               skb = vlan_untag(skb);
+               if (unlikely(!skb))
+                       return false;
+       }
+
        err = br_vlan_get_tag(skb, vid);
        if (!*vid) {
                u16 pvid = br_get_pvid(v);