]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: fix unblocking connect()
authorPaolo Abeni <pabeni@redhat.com>
Fri, 29 May 2020 15:43:29 +0000 (17:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 May 2020 04:39:13 +0000 (21:39 -0700)
commit579db16d2ae8c330ac51c3c73879f809b3b11b42
tree20cb78f94610de7a0a694a4f87436d9db51a5f9b
parent1ff4d4c57f5b80a9d69d6e86b818f22d6dc7beab
mptcp: fix unblocking connect()

Currently unblocking connect() on MPTCP sockets fails frequently.
If mptcp_stream_connect() is invoked to complete a previously
attempted unblocking connection, it will still try to create
the first subflow via __mptcp_socket_create(). If the 3whs is
completed and the 'can_ack' flag is already set, the latter
will fail with -EINVAL.

This change addresses the issue checking for pending connect and
delegating the completion to the first subflow. Additionally
do msk addresses and sk_state changes only when needed.

Fixes: a4ba69e25e7d ("mptcp: Associate MPTCP context with TCP socket")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c