diff mbox series

[mptcp-next] Squash to "mptcp: generate the data checksum"

Message ID ae2099811b8395f7718855c5c7d412b26d960c95.1621321549.git.geliangtang@gmail.com
State Accepted, archived
Headers show
Series [mptcp-next] Squash to "mptcp: generate the data checksum" | expand

Commit Message

Geliang Tang May 18, 2021, 7:06 a.m. UTC
Move this line "__wsum csum = ~csum_unfold(mpext->csum);" from "mptcp:
validate the data checksum" to "mptcp: generate the data checksum".

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mat Martineau May 20, 2021, 9:56 p.m. UTC | #1
On Tue, 18 May 2021, Geliang Tang wrote:

> Move this line "__wsum csum = ~csum_unfold(mpext->csum);" from "mptcp:
> validate the data checksum" to "mptcp: generate the data checksum".
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/protocol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 38ce8d50e665..58253bd09f93 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1311,7 +1311,7 @@ static bool mptcp_alloc_tx_skb(struct sock *sk, struct sock *ssk)
> static void mptcp_update_data_checksum(struct sk_buff *skb, int added)
> {
> 	struct mptcp_ext *mpext = mptcp_get_ext(skb);
> -	__wsum csum = csum_unfold(mpext->csum);
> +	__wsum csum = ~csum_unfold(mpext->csum);
> 	int offset = skb->len - added;
>
> 	mpext->csum = csum_fold(csum_block_add(csum, skb_checksum(skb, offset, added, 0), offset));
> -- 
> 2.31.1

Looks good, thanks Geliang.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

--
Mat Martineau
Intel
diff mbox series

Patch

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 38ce8d50e665..58253bd09f93 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1311,7 +1311,7 @@  static bool mptcp_alloc_tx_skb(struct sock *sk, struct sock *ssk)
 static void mptcp_update_data_checksum(struct sk_buff *skb, int added)
 {
 	struct mptcp_ext *mpext = mptcp_get_ext(skb);
-	__wsum csum = csum_unfold(mpext->csum);
+	__wsum csum = ~csum_unfold(mpext->csum);
 	int offset = skb->len - added;
 
 	mpext->csum = csum_fold(csum_block_add(csum, skb_checksum(skb, offset, added, 0), offset));