mptcp: avoid unneeded mptcp_token_destroy() calls
authorPaolo Abeni <pabeni@redhat.com>
Fri, 11 Aug 2023 15:57:14 +0000 (17:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2023 06:06:13 +0000 (07:06 +0100)
commit131a627751e3474bc8e33009c032feecfe8d879f
tree60901d5029e40ec1d9c12a59abef8521a92cadd3
parentf614a29d6ca6962139b0eb36b985e3dda80258a6
mptcp: avoid unneeded mptcp_token_destroy() calls

The MPTCP protocol currently clears the msk token both at connect() and
listen() time. That is needed to deal with failing connect() calls that
can create a new token while leaving the sk in TCP_CLOSE,SS_UNCONNECTED
status and thus allowing later connect() and/or listen() calls.

Let's deal with such failures explicitly, cleaning the token in a timely
manner and avoid the confusing early mptcp_token_destroy().

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c