Skip to content

Commit

Permalink
Squash-to: "mptcp: avoid additional __inet_stream_connect() call"
Browse files Browse the repository at this point in the history
In the mentioned commit I unintenionally left over a couple of
possible cleanup.

Add the following to the commit message, befere "No functional change
intended.":

"""
The sk-level connect never return -EINPROGRESS, cleanup the error
path accordingly. Additionally, the ssk status on error is always
TCP_CLOSE. Avoid unneeded access to the subflow sk state.
"""

Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni authored and intel-lab-lkp committed Jul 20, 2023
1 parent 7052677 commit e8aba1d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -3655,18 +3655,14 @@ static int mptcp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
/* on successful connect, the msk state will be moved to established by
* subflow_finish_connect()
*/
if (unlikely(err && err != -EINPROGRESS)) {
if (unlikely(err)) {
/* avoid leaving a dangling token in an unconnected socket */
mptcp_token_destroy(msk);
inet_sk_state_store(sk, inet_sk_state_load(ssk));
inet_sk_state_store(sk, TCP_CLOSE);
return err;
}

mptcp_copy_inaddrs(sk, ssk);

/* silence EINPROGRESS and let the caller inet_stream_connect
* handle the connection in progress
*/
return 0;
}

Expand Down

0 comments on commit e8aba1d

Please sign in to comment.