aboutsummaryrefslogtreecommitdiffstats
path: root/net/mptcp/protocol.c
diff options
context:
space:
mode:
authorPaolo Abeni <[email protected]>2023-08-11 15:57:16 +0000
committerDavid S. Miller <[email protected]>2023-08-14 06:06:13 +0000
commitcfb63e50d319ee5d11254c83d3ad2b135b8735db (patch)
tree2a19373b019328107393261fcc59cfe03ae5425a /net/mptcp/protocol.c
parentmptcp: avoid additional __inet_stream_connect() call (diff)
downloadkernel-cfb63e50d319ee5d11254c83d3ad2b135b8735db.tar.gz
kernel-cfb63e50d319ee5d11254c83d3ad2b135b8735db.zip
mptcp: avoid subflow socket usage in mptcp_get_port()
We are going to remove the first subflow socket soon, so avoid accessing it in mptcp_get_port(). Instead, access directly the first subflow sock. Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/mptcp/protocol.c')
-rw-r--r--net/mptcp/protocol.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b888d6339c80..891f49722263 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3405,14 +3405,12 @@ static void mptcp_unhash(struct sock *sk)
static int mptcp_get_port(struct sock *sk, unsigned short snum)
{
struct mptcp_sock *msk = mptcp_sk(sk);
- struct socket *ssock;
- ssock = msk->subflow;
- pr_debug("msk=%p, subflow=%p", msk, ssock);
- if (WARN_ON_ONCE(!ssock))
+ pr_debug("msk=%p, ssk=%p", msk, msk->first);
+ if (WARN_ON_ONCE(!msk->first))
return -EINVAL;
- return inet_csk_get_port(ssock->sk, snum);
+ return inet_csk_get_port(msk->first, snum);
}
void mptcp_finish_connect(struct sock *ssk)