]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/core/dev.c
offloading: Force software GSO for multiple vlan tags.
[net-next-2.6.git] / net / core / dev.c
index 368930a988e3e1b33acd18a28bd11fbd8286a3f1..8b500c3e02971e9a2abe7edcd16e51938554ca6a 100644 (file)
@@ -1968,6 +1968,22 @@ static inline void skb_orphan_try(struct sk_buff *skb)
        }
 }
 
+int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev)
+{
+       __be16 protocol = skb->protocol;
+
+       if (protocol == htons(ETH_P_8021Q)) {
+               struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
+               protocol = veh->h_vlan_encapsulated_proto;
+       } else if (!skb->vlan_tci)
+               return dev->features;
+
+       if (protocol != htons(ETH_P_8021Q))
+               return dev->features & dev->vlan_features;
+       else
+               return 0;
+}
+
 /*
  * Returns true if either:
  *     1. skb has frag_list and the device doesn't support FRAGLIST, or