]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
Ensure that packet csums are computed correctly when sending a GSO netback-increase-pullup
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:02 +0000 (12:06 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:02 +0000 (12:06 +0000)
packet to an interface which supports scatter-gather but not transmit
checksum offloads.

Signed-off-by: Steven Smith <ssmith@xensource.com>
net/core/dev.c

index 82d943939e1c524beab131fe8a89d8957a6c49b2..dc3042096dc1c694854c618880f7f6631c3e5b3f 100644 (file)
@@ -1369,6 +1369,18 @@ gso:
 
                skb->next = nskb->next;
                nskb->next = NULL;
+
+               if (nskb->ip_summed == CHECKSUM_HW &&
+                   (!(dev->features & NETIF_F_GEN_CSUM) &&
+                    (!(dev->features & NETIF_F_IP_CSUM) ||
+                     nskb->protocol != htons(ETH_P_IP)))) {
+                       if (skb_checksum_help(nskb, 0)) {
+                               nskb->next = skb->next;
+                               skb->next = nskb;
+                               return NETDEV_TX_BUSY;
+                       }
+               }
+
                rc = dev->hard_start_xmit(nskb, dev);
                if (unlikely(rc)) {
                        nskb->next = skb->next;