diff options
author | Matthieu Baerts <matthieu.baerts@tessares.net> | 2021-01-25 10:59:02 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-27 16:53:55 -0800 |
commit | 1f2f1931b2a8864ed30e445e360ba793c2ac5224 (patch) | |
tree | fadb89e76aa7bfc8eb444bc00eb145eaa729d757 /net/mptcp | |
parent | 7b9b0f7e1230adde95be4958469d60c6fc06bc36 (diff) | |
download | linux-1f2f1931b2a8864ed30e445e360ba793c2ac5224.tar.bz2 |
mptcp: pm nl: reduce variable scope
To avoid confusions like when working on the previous patch, better to
declare and assign this variable only where it is needed.
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mptcp')
-rw-r--r-- | net/mptcp/pm_netlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index f0afff6ba015..83976b9ee99b 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -325,7 +325,6 @@ void mptcp_pm_free_anno_list(struct mptcp_sock *msk) static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) { - struct mptcp_addr_info remote = { 0 }; struct sock *sk = (struct sock *)msk; struct mptcp_pm_addr_entry *local; struct pm_nl_pernet *pernet; @@ -359,13 +358,14 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) /* check if should create a new subflow */ if (msk->pm.local_addr_used < msk->pm.local_addr_max && msk->pm.subflows < msk->pm.subflows_max) { - remote_address((struct sock_common *)sk, &remote); - local = select_local_address(pernet, msk); if (local) { + struct mptcp_addr_info remote = { 0 }; + msk->pm.local_addr_used++; msk->pm.subflows++; check_work_pending(msk); + remote_address((struct sock_common *)sk, &remote); spin_unlock_bh(&msk->pm.lock); __mptcp_subflow_connect(sk, &local->addr, &remote); spin_lock_bh(&msk->pm.lock); |