Commit c312ee21 authored by Geliang Tang's avatar Geliang Tang Committed by Jakub Kicinski

mptcp: change the parameter of __mptcp_make_csum

This patch changed the type of the last parameter of __mptcp_make_csum()
from __sum16 to __wsum. And export this function in protocol.h.
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 327b9a94
...@@ -1233,7 +1233,7 @@ static void mptcp_set_rwin(const struct tcp_sock *tp) ...@@ -1233,7 +1233,7 @@ static void mptcp_set_rwin(const struct tcp_sock *tp)
WRITE_ONCE(msk->rcv_wnd_sent, ack_seq); WRITE_ONCE(msk->rcv_wnd_sent, ack_seq);
} }
static u16 __mptcp_make_csum(u64 data_seq, u32 subflow_seq, u16 data_len, __sum16 sum) u16 __mptcp_make_csum(u64 data_seq, u32 subflow_seq, u16 data_len, __wsum sum)
{ {
struct csum_pseudo_header header; struct csum_pseudo_header header;
__wsum csum; __wsum csum;
...@@ -1248,14 +1248,14 @@ static u16 __mptcp_make_csum(u64 data_seq, u32 subflow_seq, u16 data_len, __sum1 ...@@ -1248,14 +1248,14 @@ static u16 __mptcp_make_csum(u64 data_seq, u32 subflow_seq, u16 data_len, __sum1
header.data_len = htons(data_len); header.data_len = htons(data_len);
header.csum = 0; header.csum = 0;
csum = csum_partial(&header, sizeof(header), ~csum_unfold(sum)); csum = csum_partial(&header, sizeof(header), sum);
return (__force u16)csum_fold(csum); return (__force u16)csum_fold(csum);
} }
static u16 mptcp_make_csum(const struct mptcp_ext *mpext) static u16 mptcp_make_csum(const struct mptcp_ext *mpext)
{ {
return __mptcp_make_csum(mpext->data_seq, mpext->subflow_seq, mpext->data_len, return __mptcp_make_csum(mpext->data_seq, mpext->subflow_seq, mpext->data_len,
mpext->csum); ~csum_unfold(mpext->csum));
} }
void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp, void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
...@@ -1376,7 +1376,7 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp, ...@@ -1376,7 +1376,7 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
__mptcp_make_csum(opts->data_seq, __mptcp_make_csum(opts->data_seq,
opts->subflow_seq, opts->subflow_seq,
opts->data_len, opts->data_len,
opts->csum), ptr); ~csum_unfold(opts->csum)), ptr);
} else { } else {
put_unaligned_be32(opts->data_len << 16 | put_unaligned_be32(opts->data_len << 16 |
TCPOPT_NOP << 8 | TCPOPT_NOP, ptr); TCPOPT_NOP << 8 | TCPOPT_NOP, ptr);
......
...@@ -725,6 +725,7 @@ void mptcp_token_destroy(struct mptcp_sock *msk); ...@@ -725,6 +725,7 @@ void mptcp_token_destroy(struct mptcp_sock *msk);
void mptcp_crypto_key_sha(u64 key, u32 *token, u64 *idsn); void mptcp_crypto_key_sha(u64 key, u32 *token, u64 *idsn);
void mptcp_crypto_hmac_sha(u64 key1, u64 key2, u8 *msg, int len, void *hmac); void mptcp_crypto_hmac_sha(u64 key1, u64 key2, u8 *msg, int len, void *hmac);
u16 __mptcp_make_csum(u64 data_seq, u32 subflow_seq, u16 data_len, __wsum sum);
void __init mptcp_pm_init(void); void __init mptcp_pm_init(void);
void mptcp_pm_data_init(struct mptcp_sock *msk); void mptcp_pm_data_init(struct mptcp_sock *msk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment