Skip to content

Commit

Permalink
mptcp: move inet_sk_state_store under lock
Browse files Browse the repository at this point in the history
This patch moves inet_sk_state_store() under the socket lock in
mptcp_pm_nl_create_listen_socket(). This is a pre-req patch for
using mptcp_set_state() instead of inet_sk_state_store().

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Dec 19, 2023
1 parent d4efd41 commit 36d613c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,

lock_sock(newsk);
ssk = __mptcp_nmpc_sk(mptcp_sk(newsk));
inet_sk_state_store(newsk, TCP_LISTEN);
release_sock(newsk);
if (IS_ERR(ssk))
return PTR_ERR(ssk);
Expand All @@ -1048,7 +1049,6 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
if (err)
return err;

inet_sk_state_store(newsk, TCP_LISTEN);
lock_sock(ssk);
err = __inet_listen_sk(ssk, backlog);
if (!err)
Expand Down

0 comments on commit 36d613c

Please sign in to comment.