OSDN Git Service

mptcp: Use full MPTCP-level disconnect state machine
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Tue, 28 Jul 2020 22:12:06 +0000 (15:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jul 2020 00:02:42 +0000 (17:02 -0700)
commit43b54c6ee382f026fc93babf5301ec79e1c9614a
treef7000ee2af1d5f86cbf2c30df0e814991d0cfc5c
parent16a9a9da17234797b01ca05024d33269872a0ae0
mptcp: Use full MPTCP-level disconnect state machine

RFC 8684 appendix D describes the connection state machine for
MPTCP. This patch implements the DATA_FIN / DATA_ACK exchanges and
MPTCP-level socket state changes described in that appendix, rather than
simply sending DATA_FIN along with TCP FIN when disconnecting subflows.

DATA_FIN is now sent and acknowledged before shutting down the
subflows. Received DATA_FIN information (if not part of a data packet)
is written to the MPTCP socket when the incoming DSS option is parsed by
the subflow, and the MPTCP worker is scheduled to process the
flag. DATA_FIN received as part of a full DSS mapping will be handled
when the mapping is processed.

The DATA_FIN is acknowledged by the worker if the reader is caught
up. If there is still data to be moved to the MPTCP-level queue, ack_seq
will be incremented to account for the DATA_FIN when it reaches the end
of the stream and a DATA_ACK will be sent to the peer.

Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/options.c
net/mptcp/protocol.c
net/mptcp/subflow.c