diff options
author | Mat Martineau <mathew.j.martineau@linux.intel.com> | 2020-02-28 15:47:40 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-03 17:01:43 -0800 |
commit | 76c42a29c0eb15ea3fdc9867a0a52e53fb4fbd76 (patch) | |
tree | dda4bfc901f985c1b14b0a51a49c9f0e6c74bf8b /net/mptcp/options.c | |
parent | 1954b86016cf8522970e1b7aba801233d777ec47 (diff) | |
download | linux-76c42a29c0eb15ea3fdc9867a0a52e53fb4fbd76.tar.gz linux-76c42a29c0eb15ea3fdc9867a0a52e53fb4fbd76.tar.bz2 linux-76c42a29c0eb15ea3fdc9867a0a52e53fb4fbd76.zip |
mptcp: Use per-subflow storage for DATA_FIN sequence number
Instead of reading the MPTCP-level sequence number when sending DATA_FIN,
store the data in the subflow so it can be safely accessed when the
subflow TCP headers are written to the packet without the MPTCP-level
lock held. This also allows the MPTCP-level socket to close individual
subflows without closing the MPTCP connection.
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/options.c')
-rw-r--r-- | net/mptcp/options.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 45acd877bef3..90c81953ec2c 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -312,7 +312,7 @@ static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow, */ ext->use_map = 1; ext->dsn64 = 1; - ext->data_seq = mptcp_sk(subflow->conn)->write_seq; + ext->data_seq = subflow->data_fin_tx_seq; ext->subflow_seq = 0; ext->data_len = 1; } else { @@ -354,8 +354,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb, if (mpext) opts->ext_copy = *mpext; - if (skb && tcp_fin && - subflow->conn->sk_state != TCP_ESTABLISHED) + if (skb && tcp_fin && subflow->data_fin_tx_enable) mptcp_write_data_fin(subflow, &opts->ext_copy); ret = true; } |