summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2009-11-17 17:28:00 -0800
committerJesse Gross <jesse@nicira.com>2009-11-18 13:40:36 -0800
commit5ef800a6909fabfb2331a2da90450c23ca61aa06 (patch)
tree8c055f45d272075478b9fb0f11ab93cc9c5c96e7
parent8fe1a59d281369829f474dc75eb5905c991ccd94 (diff)
downloadopenvswitch-5ef800a6909fabfb2331a2da90450c23ca61aa06.tar.gz
datapath: Copy Xen's checksumming fields when doing skb_copy.
Two fields that control checksumming were added to sk_buff in Xen: proto_data_valid and proto_csum_blank. These fields are copied when doing a skb_clone but not in other functions such as skb_copy, which can lead to checksum errors in TCP and UDP when offloading is enabled in the guest. To fix this we manually copy these fields, though ideally this should be fixed upstream in Xen. Bug #2299
-rw-r--r--datapath/actions.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/datapath/actions.c b/datapath/actions.c
index a037e4320..226a4f91a 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -28,6 +28,13 @@ make_writable(struct sk_buff *skb, gfp_t gfp)
if (skb_shared(skb) || skb_cloned(skb)) {
struct sk_buff *nskb = skb_copy(skb, gfp);
if (nskb) {
+#if defined(CONFIG_XEN) && LINUX_VERSION_CODE == KERNEL_VERSION(2,6,18)
+ /* These fields are copied in skb_clone but not in
+ * skb_copy or related functions. We need to manually
+ * copy them over here. */
+ nskb->proto_data_valid = skb->proto_data_valid;
+ nskb->proto_csum_blank = skb->proto_csum_blank;
+#endif
kfree_skb(skb);
return nskb;
}