]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: factor out mptcp_connect()
authorPaolo Abeni <pabeni@redhat.com>
Fri, 21 Oct 2022 22:58:55 +0000 (15:58 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Oct 2022 04:13:55 +0000 (21:13 -0700)
commite579b981ff1592f4ec183d2498e4c5a31a339e81
treee054b5d875d492c97f6221e7773d326ff294253e
parentbe0bad3832207c47b792080f3e3bbbf13498e9a1
mptcp: factor out mptcp_connect()

The current MPTCP connect implementation duplicates a bit of inet
code and does not use nor provide a struct proto->connect callback,
which in turn will not fit the upcoming fastopen implementation.

Refactor such implementation to use the common helper, moving the
MPTCP-specific bits into mptcp_connect(). Additionally, avoid an
indirect call to the subflow connect callback.

Note that the fastopen call-path invokes mptcp_connect() while already
holding the subflow socket lock. Explicitly keep track of such path
via a new MPTCP-level flag and handle the locking accordingly.

Additionally, track the connect flags in a new msk field to allow
propagating them to the subflow inet_stream_connect call.

Fixes: 7a21156d1e6c ("mptcp: handle defer connect in mptcp_sendmsg")
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: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c
net/mptcp/protocol.h