]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mptcp: fix unblocking connect()
authorPaolo Abeni <pabeni@redhat.com>
Fri, 29 May 2020 15:43:29 +0000 (17:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jun 2020 18:22:49 +0000 (20:22 +0200)
commit63f44aba259208f4939e3798de75cd99dd657462
treeada07a16866c3cc6e4d3aad5bd61fd38ff39a1b0
parent691f6c833612df03ecfee7d0f579979bfc6f78e4
mptcp: fix unblocking connect()

[ Upstream commit 41be81a8d3d09acb9033799938306349328861f9 ]

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: 2303f994b3e1 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mptcp/protocol.c