From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH 3/3] mptcp: Use correct address family when creating subflows
Date: Mon, 21 Oct 2019 16:41:52 -0700 [thread overview]
Message-ID: <20191021234152.3091-4-peter.krystad@linux.intel.com> (raw)
In-Reply-To: 20191021234152.3091-1-peter.krystad@linux.intel.com
[-- 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
reply other threads:[~2019-10-21 23:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191021234152.3091-4-peter.krystad@linux.intel.com \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.