mptcp: use fastclose on more edge scenarios
authorPaolo Abeni <pabeni@redhat.com>
Fri, 30 Sep 2022 15:59:32 +0000 (08:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Oct 2022 10:18:53 +0000 (11:18 +0100)
commitd21f8348551831efd917528afc545832a372426e
treeaa514dfc2f09d1c76b4bcd1457b24069808afc69
parent69800e516e968fa1cf9202b872dc86515eeeebe6
mptcp: use fastclose on more edge scenarios

Daire reported a user-space application hang-up when the
peer is forcibly closed before the data transfer completion.

The relevant application expects the peer to either
do an application-level clean shutdown or a transport-level
connection reset.

We can accommodate a such user by extending the fastclose
usage: at fd close time, if the msk socket has some unread
data, and at FIN_WAIT timeout.

Note that at MPTCP close time we must ensure that the TCP
subflows will reset: set the linger socket option to a suitable
value.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c