openvswitch: more accurate checksumming in queue_userspace_packet()
authorDavide Caratti <dcaratti@redhat.com>
Thu, 18 May 2017 13:44:42 +0000 (15:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 May 2017 23:21:29 +0000 (19:21 -0400)
if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs
CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid
corrupting such packets while queueing them towards userspace.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/datapath.c

index 7b17da9..9ddc9f8 100644 (file)
@@ -453,7 +453,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 
        /* Complete checksum if needed */
        if (skb->ip_summed == CHECKSUM_PARTIAL &&
-           (err = skb_checksum_help(skb)))
+           (err = skb_csum_hwoffload_help(skb, 0)))
                goto out;
 
        /* Older versions of OVS user space enforce alignment of the last