[NET] gso: Fix up GSO packets with broken checksums
[linux-block.git] / include / linux / netdevice.h
index 0359a6430018ed62b07d8a2cb6e5cc2876b32f9f..76cc099c8580fa06551f98f0ec2635f2c2a85496 100644 (file)
@@ -549,6 +549,7 @@ struct packet_type {
                                         struct net_device *);
        struct sk_buff          *(*gso_segment)(struct sk_buff *skb,
                                                int features);
+       int                     (*gso_send_check)(struct sk_buff *skb);
        void                    *af_packet_priv;
        struct list_head        list;
 };
@@ -1001,13 +1002,14 @@ static inline int net_gso_ok(int features, int gso_type)
 
 static inline int skb_gso_ok(struct sk_buff *skb, int features)
 {
-       return net_gso_ok(features, skb_is_gso(skb) ?
-                                   skb_shinfo(skb)->gso_type : 0);
+       return net_gso_ok(features, skb_shinfo(skb)->gso_type);
 }
 
 static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
 {
-       return !skb_gso_ok(skb, dev->features);
+       return skb_is_gso(skb) &&
+              (!skb_gso_ok(skb, dev->features) ||
+               unlikely(skb->ip_summed != CHECKSUM_HW));
 }
 
 #endif /* __KERNEL__ */