From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Tranchetti Subject: [PATCH net-next] udp: Complement partial checksum for GSO packet Date: Mon, 30 Apr 2018 18:01:02 -0600 Message-ID: <1525132862-7672-1-git-send-email-stranche@codeaurora.org> Cc: Sean Tranchetti , Subash Abhinov Kasiviswanathan To: willemb@google.com, davem@davemloft.net, netdev@vger.kernel.org Return-path: Received: from alexa-out.qualcomm.com ([129.46.98.28]:60336 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754055AbeEAABZ (ORCPT ); Mon, 30 Apr 2018 20:01:25 -0400 Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/ipv4/udp_offload.c | 1 + 1 file changed, 1 insertion(+) 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; -- 1.9.1