]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.git/commitdiff
Ensure that packet csums are computed correctly when sending a GSO
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 11:55:48 +0000 (12:55 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 11:55:48 +0000 (12:55 +0100)
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 f16dfec146c9e43876bf40245c39f76947bcfa78..0eca3f796b4ad8de2a2913aabc95867ab8d214bc 100644 (file)
@@ -1655,6 +1655,18 @@ gso:
 
                skb->next = nskb->next;
                nskb->next = NULL;
+
+               if (nskb->ip_summed == CHECKSUM_PARTIAL &&
+                   (!(dev->features & NETIF_F_GEN_CSUM) &&
+                    (!(dev->features & NETIF_F_IP_CSUM) ||
+                     nskb->protocol != htons(ETH_P_IP)))) {
+                       if (skb_checksum_help(nskb)) {
+                               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;