]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.bak/.git/commitdiff
Ensure that packet csums are computed correctly when sending a GSO
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Thu, 28 May 2009 10:54:20 +0000 (11:54 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Thu, 28 May 2009 10:54:20 +0000 (11:54 +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 ca3939bd136174d23366ea34fdf9044da604beb8..2c0c5e733c88dc9ab1f765a2965560411fd99509 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;