diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index e959104832efa244d7a20b417922ea9f950836b6..92d5382e71f4470b4679fe115125e914c9f1022a 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1055,10 +1055,6 @@ void mptcp_finish_connect(struct sock *ssk) WRITE_ONCE(msk->write_seq, subflow->idsn + 1); WRITE_ONCE(msk->ack_seq, ack_seq); WRITE_ONCE(msk->can_ack, 1); - if (inet_sk_state_load(sk) != TCP_ESTABLISHED) { - inet_sk_state_store(sk, TCP_ESTABLISHED); - sk->sk_state_change(sk); - } } static void mptcp_sock_graft(struct sock *sk, struct socket *parent) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index e1faa88855bff84fef242568ab96638912d9731c..5bae12da2769972fceedaa4bc77e537e543ccf87 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -109,9 +109,15 @@ static void subflow_v6_init_req(struct request_sock *req, static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) { struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk); + struct sock *parent = subflow->conn; subflow->icsk_af_ops->sk_rx_dst_set(sk, skb); + if (inet_sk_state_load(parent) != TCP_ESTABLISHED) { + inet_sk_state_store(parent, TCP_ESTABLISHED); + parent->sk_state_change(parent); + } + if (!subflow->conn_finished) { pr_debug("subflow=%p, remote_key=%llu", mptcp_subflow_ctx(sk), subflow->remote_key);