mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
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 <pabeni@redhat.com> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ccae357c1c
commit
cfb63e50d3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user