[PATCH mptcp-net v6 02/11] Squash to "mptcp: pm: fullmesh: select the right ID later"

Matthieu Baerts (NGI0) posted 11 patches 4 months ago
There is a newer version of this series
[PATCH mptcp-net v6 02/11] Squash to "mptcp: pm: fullmesh: select the right ID later"
Posted by Matthieu Baerts (NGI0) 4 months ago
We don't need to depend on msk->first to get the source address of the
initial subflow: it can be retrieved from the msk itself.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/pm_netlink.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 3e552b4f1a21..605cfd7bc004 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -661,8 +661,7 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk,
 	pernet = pm_nl_get_pernet_from_msk(msk);
 	subflows_max = mptcp_pm_get_subflows_max(msk);
 
-	if (msk->first)
-		mptcp_local_address((struct sock_common *)msk->first, &mpc_addr);
+	mptcp_local_address((struct sock_common *)msk, &mpc_addr);
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
@@ -678,8 +677,7 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk,
 			locals[i].ifindex = entry->ifindex;
 
 			/* Special case for ID0: set the correct ID */
-			if (msk->first &&
-			    mptcp_addresses_equal(&locals[i].addr, &mpc_addr, locals[i].addr.port))
+			if (mptcp_addresses_equal(&locals[i].addr, &mpc_addr, locals[i].addr.port))
 				locals[i].addr.id = 0;
 
 			msk->pm.subflows++;

-- 
2.45.2