diff options
author | Geliang Tang <geliangtang@xiaomi.com> | 2021-08-24 16:26:17 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-25 11:02:35 +0100 |
commit | 478d770008b03ed9d74bdc8add2315b7fd124ecc (patch) | |
tree | 133300480ecb1247b7d2463971b8ca379000ec62 /net/mptcp/protocol.h | |
parent | 5580d41b758af12134d5c6b4c385fc25d0c6bfb0 (diff) | |
download | linux-478d770008b03ed9d74bdc8add2315b7fd124ecc.tar.bz2 |
mptcp: send out MP_FAIL when data checksum fails
When a bad checksum is detected, set the send_mp_fail flag to send out
the MP_FAIL option.
Add a new function mptcp_has_another_subflow() to check whether there's
only a single subflow.
When multiple subflows are in use, close the affected subflow with a RST
that includes an MP_FAIL option and discard the data with the bad
checksum.
Set the sk_state of the subsocket to TCP_CLOSE, then the flag
MPTCP_WORK_CLOSE_SUBFLOW will be set in subflow_sched_work_if_closed,
and the subflow will be closed.
When a single subfow is in use, temporarily handled by sending MP_FAIL
with a RST too.
Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/protocol.h')
-rw-r--r-- | net/mptcp/protocol.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 9ee5676e70c6..57a50b1194a9 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -614,6 +614,19 @@ static inline void mptcp_subflow_tcp_fallback(struct sock *sk, inet_csk(sk)->icsk_af_ops = ctx->icsk_af_ops; } +static inline bool mptcp_has_another_subflow(struct sock *ssk) +{ + struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk), *tmp; + struct mptcp_sock *msk = mptcp_sk(subflow->conn); + + mptcp_for_each_subflow(msk, tmp) { + if (tmp != subflow) + return true; + } + + return false; +} + void __init mptcp_proto_init(void); #if IS_ENABLED(CONFIG_MPTCP_IPV6) int __init mptcp_proto_v6_init(void); |