All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH 3/3] mptcp: Use correct address family when creating subflows
@ 2019-10-21 23:41 Peter Krystad
  0 siblings, 0 replies; only message in thread
From: Peter Krystad @ 2019-10-21 23:41 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1677 bytes --]

Use the address family used when the initial MPTCP socket
was created when making additional subflow sockets.

squashto: Implement basic path manager

Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/basic.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/net/mptcp/basic.c b/net/mptcp/basic.c
index d2fd0560c136..2557cb63fd61 100644
--- a/net/mptcp/basic.c
+++ b/net/mptcp/basic.c
@@ -209,19 +209,23 @@ static void create_subflow_worker(struct work_struct *work)
 
 	pernet = net_generic(sock_net((struct sock *)msk), basic_pernet_id);
 
-	if (pernet->has_announce_v4)
-		mptcp_pm_create_subflow(pm->token, pm->remote_id,
-					&pernet->announce_v4_addr);
-#if IS_ENABLED(CONFIG_IPV6)
-	else if (pernet->has_announce_v6)
-		mptcp_pm_create_subflow6(pm->token, pm->remote_id,
-					 &pernet->announce_v6_addr);
-#endif
-	else if (pm->local_family == AF_INET)
-		mptcp_pm_create_subflow(pm->token, pm->remote_id, NULL);
+	if (msk->family == AF_INET) {
+		if (pernet->has_announce_v4)
+			mptcp_pm_create_subflow(pm->token, pm->remote_id,
+						&pernet->announce_v4_addr);
+		else
+			mptcp_pm_create_subflow(pm->token, pm->remote_id,
+						NULL);
+	}
 #if IS_ENABLED(CONFIG_IPV6)
-	else
-		mptcp_pm_create_subflow6(pm->token, pm->remote_id, NULL);
+	else if (msk->family == AF_INET6) {
+		if (pernet->has_announce_v6)
+			mptcp_pm_create_subflow6(pm->token, pm->remote_id,
+						 &pernet->announce_v6_addr);
+		else
+			mptcp_pm_create_subflow6(pm->token, pm->remote_id,
+						 NULL);
+	}
 #endif
 
 	sock_put((struct sock *)msk);
-- 
2.17.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-21 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 23:41 [MPTCP] [PATCH 3/3] mptcp: Use correct address family when creating subflows Peter Krystad

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.