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

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: default avatarPaolo Abeni <pabeni@redhat.com>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ccae357c
...@@ -3405,14 +3405,12 @@ static void mptcp_unhash(struct sock *sk) ...@@ -3405,14 +3405,12 @@ static void mptcp_unhash(struct sock *sk)
static int mptcp_get_port(struct sock *sk, unsigned short snum) static int mptcp_get_port(struct sock *sk, unsigned short snum)
{ {
struct mptcp_sock *msk = mptcp_sk(sk); struct mptcp_sock *msk = mptcp_sk(sk);
struct socket *ssock;
ssock = msk->subflow; pr_debug("msk=%p, ssk=%p", msk, msk->first);
pr_debug("msk=%p, subflow=%p", msk, ssock); if (WARN_ON_ONCE(!msk->first))
if (WARN_ON_ONCE(!ssock))
return -EINVAL; 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) void mptcp_finish_connect(struct sock *ssk)
......
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