]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/if_vlan.h
Merge tag 'platform-drivers-x86-v4.12-2' of git://git.infradead.org/linux-platform...
[karo-tx-linux.git] / include / linux / if_vlan.h
index 8d5fcd6284ce0f4702d9eb28703bf2ae80d7e399..283dc2f5364d77c13df5a16ed0474154ee6724ff 100644 (file)
@@ -614,14 +614,16 @@ static inline bool skb_vlan_tagged_multi(const struct sk_buff *skb)
 static inline netdev_features_t vlan_features_check(const struct sk_buff *skb,
                                                    netdev_features_t features)
 {
-       if (skb_vlan_tagged_multi(skb))
-               features = netdev_intersect_features(features,
-                                                    NETIF_F_SG |
-                                                    NETIF_F_HIGHDMA |
-                                                    NETIF_F_FRAGLIST |
-                                                    NETIF_F_HW_CSUM |
-                                                    NETIF_F_HW_VLAN_CTAG_TX |
-                                                    NETIF_F_HW_VLAN_STAG_TX);
+       if (skb_vlan_tagged_multi(skb)) {
+               /* In the case of multi-tagged packets, use a direct mask
+                * instead of using netdev_interesect_features(), to make
+                * sure that only devices supporting NETIF_F_HW_CSUM will
+                * have checksum offloading support.
+                */
+               features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
+                           NETIF_F_FRAGLIST | NETIF_F_HW_VLAN_CTAG_TX |
+                           NETIF_F_HW_VLAN_STAG_TX;
+       }
 
        return features;
 }