Commit 7f20d5fc authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

mptcp: move msk state update to subflow_syn_recv_sock()

After commit 58b09919 ("mptcp: create msk early"), the
msk socket is already available at subflow_syn_recv_sock()
time. Let's move there the state update, to mirror more
closely the first subflow state.

The above will also help multiple subflow supports.
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5dd32845
...@@ -861,6 +861,9 @@ struct sock *mptcp_sk_clone(const struct sock *sk, struct request_sock *req) ...@@ -861,6 +861,9 @@ struct sock *mptcp_sk_clone(const struct sock *sk, struct request_sock *req)
ack_seq++; ack_seq++;
msk->ack_seq = ack_seq; msk->ack_seq = ack_seq;
} }
/* will be fully established after successful MPC subflow creation */
inet_sk_state_store(nsk, TCP_SYN_RECV);
bh_unlock_sock(nsk); bh_unlock_sock(nsk);
/* keep a single reference */ /* keep a single reference */
...@@ -916,10 +919,6 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err, ...@@ -916,10 +919,6 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
mptcp_copy_inaddrs(newsk, ssk); mptcp_copy_inaddrs(newsk, ssk);
list_add(&subflow->node, &msk->conn_list); list_add(&subflow->node, &msk->conn_list);
/* will be fully established at mptcp_stream_accept()
* completion.
*/
inet_sk_state_store(new_mptcp_sock, TCP_SYN_RECV);
bh_unlock_sock(new_mptcp_sock); bh_unlock_sock(new_mptcp_sock);
local_bh_enable(); local_bh_enable();
} }
...@@ -1256,8 +1255,6 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock, ...@@ -1256,8 +1255,6 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
if (!ssk->sk_socket) if (!ssk->sk_socket)
mptcp_sock_graft(ssk, newsock); mptcp_sock_graft(ssk, newsock);
} }
inet_sk_state_store(newsock->sk, TCP_ESTABLISHED);
} }
sock_put(ssock->sk); sock_put(ssock->sk);
......
...@@ -234,6 +234,8 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, ...@@ -234,6 +234,8 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
/* new mpc subflow takes ownership of the newly /* new mpc subflow takes ownership of the newly
* created mptcp socket * created mptcp socket
*/ */
inet_sk_state_store((struct sock *)new_msk,
TCP_ESTABLISHED);
ctx->conn = new_msk; ctx->conn = new_msk;
new_msk = NULL; new_msk = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment