X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=datapath%2Fdatapath.c;h=e1320f24d12e56784cab08ed784c3eedbeccfc88;hb=b9f9f37fb7a85dbe58a260f6e1b745a17db66dd5;hp=9b34fcc548b2c223f37f0ecbe7260661cecce652;hpb=8d5ebd839b86463c72239fe972001e4f1a367a7b;p=openvswitch diff --git a/datapath/datapath.c b/datapath/datapath.c index 9b34fcc5..e1320f24 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -757,8 +757,9 @@ queue_control_packets(struct sk_buff *skb, struct sk_buff_head *queue, err = vswitch_skb_checksum_setup(skb); if (err) goto err_kfree_skbs; -#ifndef CHECKSUM_HW + if (skb->ip_summed == CHECKSUM_PARTIAL) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) /* Until 2.6.22, the start of the transport header was * also the start of data to be checksummed. Linux @@ -769,17 +770,11 @@ queue_control_packets(struct sk_buff *skb, struct sk_buff_head *queue, skb_set_transport_header(skb, skb->csum_start - skb_headroom(skb)); #endif + err = skb_checksum_help(skb); if (err) goto err_kfree_skbs; } -#else - if (skb->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(skb, 0); - if (err) - goto err_kfree_skbs; - } -#endif err = skb_cow(skb, sizeof *header); if (err)