mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 22:24:09 +08:00
mptcp: send out checksum for DSS
In mptcp_write_options, if the checksum is enabled, adjust the option length and send out the data checksum with DSS suboption. Co-developed-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c94b1f96dc
commit
c5b39e26d0
@ -478,6 +478,9 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,
|
|||||||
if (data_len > 0) {
|
if (data_len > 0) {
|
||||||
len = TCPOLEN_MPTCP_MPC_ACK_DATA;
|
len = TCPOLEN_MPTCP_MPC_ACK_DATA;
|
||||||
if (opts->csum_reqd) {
|
if (opts->csum_reqd) {
|
||||||
|
/* we need to propagate more info to csum the pseudo hdr */
|
||||||
|
opts->ext_copy.data_seq = mpext->data_seq;
|
||||||
|
opts->ext_copy.subflow_seq = mpext->subflow_seq;
|
||||||
opts->ext_copy.csum = mpext->csum;
|
opts->ext_copy.csum = mpext->csum;
|
||||||
len += TCPOLEN_MPTCP_DSS_CHECKSUM;
|
len += TCPOLEN_MPTCP_DSS_CHECKSUM;
|
||||||
}
|
}
|
||||||
@ -545,18 +548,21 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
u64 ack_seq;
|
u64 ack_seq;
|
||||||
|
|
||||||
|
opts->csum_reqd = READ_ONCE(msk->csum_enabled);
|
||||||
mpext = skb ? mptcp_get_ext(skb) : NULL;
|
mpext = skb ? mptcp_get_ext(skb) : NULL;
|
||||||
|
|
||||||
if (!skb || (mpext && mpext->use_map) || snd_data_fin_enable) {
|
if (!skb || (mpext && mpext->use_map) || snd_data_fin_enable) {
|
||||||
unsigned int map_size;
|
unsigned int map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
|
||||||
|
|
||||||
map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
|
if (mpext) {
|
||||||
|
if (opts->csum_reqd)
|
||||||
|
map_size += TCPOLEN_MPTCP_DSS_CHECKSUM;
|
||||||
|
|
||||||
|
opts->ext_copy = *mpext;
|
||||||
|
}
|
||||||
|
|
||||||
remaining -= map_size;
|
remaining -= map_size;
|
||||||
dss_size = map_size;
|
dss_size = map_size;
|
||||||
if (mpext)
|
|
||||||
opts->ext_copy = *mpext;
|
|
||||||
|
|
||||||
if (skb && snd_data_fin_enable)
|
if (skb && snd_data_fin_enable)
|
||||||
mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
|
mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
|
||||||
ret = true;
|
ret = true;
|
||||||
@ -1346,6 +1352,9 @@ mp_capable_done:
|
|||||||
flags |= MPTCP_DSS_HAS_MAP | MPTCP_DSS_DSN64;
|
flags |= MPTCP_DSS_HAS_MAP | MPTCP_DSS_DSN64;
|
||||||
if (mpext->data_fin)
|
if (mpext->data_fin)
|
||||||
flags |= MPTCP_DSS_DATA_FIN;
|
flags |= MPTCP_DSS_DATA_FIN;
|
||||||
|
|
||||||
|
if (opts->csum_reqd)
|
||||||
|
len += TCPOLEN_MPTCP_DSS_CHECKSUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
*ptr++ = mptcp_option(MPTCPOPT_DSS, len, 0, flags);
|
*ptr++ = mptcp_option(MPTCPOPT_DSS, len, 0, flags);
|
||||||
@ -1365,8 +1374,13 @@ mp_capable_done:
|
|||||||
ptr += 2;
|
ptr += 2;
|
||||||
put_unaligned_be32(mpext->subflow_seq, ptr);
|
put_unaligned_be32(mpext->subflow_seq, ptr);
|
||||||
ptr += 1;
|
ptr += 1;
|
||||||
put_unaligned_be32(mpext->data_len << 16 |
|
if (opts->csum_reqd) {
|
||||||
TCPOPT_NOP << 8 | TCPOPT_NOP, ptr);
|
put_unaligned_be32(mpext->data_len << 16 |
|
||||||
|
mptcp_make_csum(mpext), ptr);
|
||||||
|
} else {
|
||||||
|
put_unaligned_be32(mpext->data_len << 16 |
|
||||||
|
TCPOPT_NOP << 8 | TCPOPT_NOP, ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user