From: Sean Tranchetti Date: Tue, 1 May 2018 00:01:02 +0000 (-0600) Subject: udp: Complement partial checksum for GSO packet X-Git-Tag: v4.19~872^2~328 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c035ba7e73aba4536a1112f9a0901ab40aab460;p=platform%2Fkernel%2Flinux-rpi.git udp: Complement partial checksum for GSO packet Using the udp_v4_check() function to calculate the pseudo header for the newly segmented UDP packets results in assigning the complement of the value to the UDP header checksum field. Always undo the complement the partial checksum value in order to match the case where GSO is not used on the UDP transmit path. Fixes: ee80d1ebe5ba ("udp: add udp gso") Signed-off-by: Sean Tranchetti Signed-off-by: Subash Abhinov Kasiviswanathan Acked-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index f78fb36..0062570 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -223,6 +223,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, csum_replace2(&uh->check, htons(mss), htons(seg->len - hdrlen - sizeof(*uh))); + uh->check = ~uh->check; seg->destructor = sock_wfree; seg->sk = sk; sum_truesize += seg->truesize;