提交 6c035ba7 编写于 作者: S Sean Tranchetti 提交者: David S. Miller

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: ee80d1eb ("udp: add udp gso")
Signed-off-by: NSean Tranchetti <stranche@codeaurora.org>
Signed-off-by: NSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Acked-by: NWillem de Bruijn <willemb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 702353b5
...@@ -223,6 +223,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, ...@@ -223,6 +223,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
csum_replace2(&uh->check, htons(mss), csum_replace2(&uh->check, htons(mss),
htons(seg->len - hdrlen - sizeof(*uh))); htons(seg->len - hdrlen - sizeof(*uh)));
uh->check = ~uh->check;
seg->destructor = sock_wfree; seg->destructor = sock_wfree;
seg->sk = sk; seg->sk = sk;
sum_truesize += seg->truesize; sum_truesize += seg->truesize;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册