mptcp: fix active subflow finalization
authorPaolo Abeni <pabeni@redhat.com>
Wed, 31 May 2023 19:37:08 +0000 (12:37 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Jun 2023 17:04:04 +0000 (10:04 -0700)
commit55b47ca7d80814ceb63d64e032e96cd6777811e5
tree137c7c1fd0f3db1180862504c463d369cbb0d2df
parent6b9831bfd9322b297eb6d44257808cc055fdc586
mptcp: fix active subflow finalization

Active subflow are inserted into the connection list at creation time.
When the MPJ handshake completes successfully, a new subflow creation
netlink event is generated correctly, but the current code wrongly
avoid initializing a couple of subflow data.

The above will cause misbehavior on a few exceptional events: unneeded
mptcp-level retransmission on msk-level sequence wrap-around and infinite
mapping fallback even when a MPJ socket is present.

Address the issue factoring out the needed initialization in a new helper
and invoking the latter from __mptcp_finish_join() time for passive
subflow and from mptcp_finish_join() for active ones.

Fixes: 0530020a7c8f ("mptcp: track and update contiguous data status")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c