From: Mat Martineau <hidden> Date: 2021-01-26 02:14:36
This patch series from the MPTCP tree adds support for IPv4-mapped IPv6
addressing that was missing when multiple subflows were first
implemented.
Patches 1 and 2 handle the conversion and comparison of the mapped
addresses.
Patch 3 contains a minor refactor in the path manager's handling of
addresses.
Patches 4 and 5 add selftests for the new functionality and adjust the
selftest timeout.
Geliang Tang (1):
selftests: mptcp: add IPv4-mapped IPv6 testcases
Matthieu Baerts (4):
mptcp: support MPJoin with IPv4 mapped in v6 sk
mptcp: pm nl: support IPv4 mapped in v6 addresses
mptcp: pm nl: reduce variable scope
selftests: increase timeout to 10 min
net/mptcp/pm_netlink.c | 39 +++++++---
net/mptcp/subflow.c | 24 ++++--
.../testing/selftests/net/mptcp/mptcp_join.sh | 75 +++++++++++++++++++
tools/testing/selftests/net/mptcp/settings | 2 +-
4 files changed, 120 insertions(+), 20 deletions(-)
base-commit: a61e4b60761fa7fa2cfde6682760763537ce5549
--
2.30.0
From: Mat Martineau <hidden> Date: 2021-01-25 19:03:50
From: Matthieu Baerts <redacted>
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 <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm_netlink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -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((structsock_common*)sk,&remote);-local=select_local_address(pernet,msk);if(local){+structmptcp_addr_inforemote={0};+msk->pm.local_addr_used++;msk->pm.subflows++;check_work_pending(msk);+remote_address((structsock_common*)sk,&remote);spin_unlock_bh(&msk->pm.lock);__mptcp_subflow_connect(sk,&local->addr,&remote);spin_lock_bh(&msk->pm.lock);
From: Mat Martineau <hidden> Date: 2021-01-25 19:05:07
From: Geliang Tang <redacted>
Here, we make sure we support IPv4-mapped in IPv6 addresses in different
contexts:
- a v4-mapped address is received by the PM and can be used as v4.
- a v4 address is received by the PM and can be used even with a v4
mapped socket.
We also make sure we don't try to establish subflows between v4 and v6
addresses, e.g. if a real v6 address ends with a valid v4 address.
Co-developed-by: Matthieu Baerts <redacted>
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <redacted>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 75 +++++++++++++++++++
1 file changed, 75 insertions(+)
@@ -790,6 +790,81 @@ chk_join_nr "remove subflow and signal IPv6" 2 2 2 chk_add_nr11 chk_rm_nr11+# subflow IPv4-mapped to IPv4-mapped+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctladd"::ffff:10.0.3.2"flagssubflow+run_tests$ns1$ns2"::ffff:10.0.1.1"+chk_join_nr"single subflow IPv4-mapped"111++# signal address IPv4-mapped with IPv4-mapped sk+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits11+ipnetnsexec$ns1./pm_nl_ctladd"::ffff:10.0.2.1"flagssignal+run_tests$ns1$ns2"::ffff:10.0.1.1"+chk_join_nr"signal address IPv4-mapped"111+chk_add_nr11++# subflow v4-map-v6+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctladd10.0.3.2flagssubflow+run_tests$ns1$ns2"::ffff:10.0.1.1"+chk_join_nr"single subflow v4-map-v6"111++# signal address v4-map-v6+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits11+ipnetnsexec$ns1./pm_nl_ctladd10.0.2.1flagssignal+run_tests$ns1$ns2"::ffff:10.0.1.1"+chk_join_nr"signal address v4-map-v6"111+chk_add_nr11++# subflow v6-map-v4+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctladd"::ffff:10.0.3.2"flagssubflow+run_tests$ns1$ns210.0.1.1+chk_join_nr"single subflow v6-map-v4"111++# signal address v6-map-v4+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits11+ipnetnsexec$ns1./pm_nl_ctladd"::ffff:10.0.2.1"flagssignal+run_tests$ns1$ns210.0.1.1+chk_join_nr"signal address v6-map-v4"111+chk_add_nr11++# no subflow IPv6 to v4 address+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctladddead:beef:2::2flagssubflow+run_tests$ns1$ns210.0.1.1+chk_join_nr"no JOIN with diff families v4-v6"000++# no subflow IPv6 to v4 address even if v6 has a valid v4 at the end+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctladddead:beef:2::10.0.3.2flagssubflow+run_tests$ns1$ns210.0.1.1+chk_join_nr"no JOIN with diff families v4-v6-2"000++# no subflow IPv4 to v6 address, no need to slow down too then+reset+ipnetnsexec$ns1./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctllimits01+ipnetnsexec$ns2./pm_nl_ctladd10.0.3.2flagssubflow+run_tests$ns1$ns2dead:beef:1::1+chk_join_nr"no JOIN with diff families v6-v4"000+# single subflow, backup reset ipnetnsexec$ns1./pm_nl_ctllimits01
From: Mat Martineau <hidden> Date: 2021-01-26 02:14:36
From: Matthieu Baerts <redacted>
With an IPv4 mapped in v6 socket, we were trying to call inet6_bind()
with an IPv4 address resulting in a -EINVAL error because the given
addr_len -- size of the address structure -- was too short.
We now make sure to use address structures for the same family as the
MPTCP socket for both the bind() and the connect(). It means we convert
v4 addresses to v4 mapped in v6 or the opposite if needed.
Fixes: ec3edaa7ca6c ("mptcp: Add handling of outgoing MP_JOIN requests")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/122
Co-developed-by: Geliang Tang <redacted>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/subflow.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
From: Mat Martineau <hidden> Date: 2021-01-26 05:30:44
From: Matthieu Baerts <redacted>
On slow systems with kernel debug settings, we can reach the current
timeout when all tests are executed.
Likely some tests need be improved to remove some 'sleep' and wait
(less) for a specific action. This can also improve stability.
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Mat Martineau <redacted>
---
tools/testing/selftests/net/mptcp/settings | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Mat Martineau <hidden> Date: 2021-01-26 19:55:47
From: Matthieu Baerts <redacted>
On one side, we can allow the creation of subflows between v4 mapped in
v6 and v4 addresses. For that we look for v4mapped addresses between the
local address we want to select and the remote one.
On the other side, we also properly deal with received v4mapped
addresses, either announced ones or set via Netlink.
Fixes: 01cacb00b35c ("mptcp: add netlink-based PM")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/122
Suggested-by: Mat Martineau <redacted>
Co-developed-by: Geliang Tang <redacted>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Matthieu Baerts <redacted>
Signed-off-by: Mat Martineau <redacted>
---
net/mptcp/pm_netlink.c | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
@@ -144,11 +150,20 @@ select_local_address(const struct pm_nl_pernet *pernet,if(!(entry->addr.flags&MPTCP_PM_ADDR_FLAG_SUBFLOW))continue;+if(entry->addr.family!=sk->sk_family){+#if IS_ENABLED(CONFIG_MPTCP_IPV6)+if((entry->addr.family==AF_INET&&+!ipv6_addr_v4mapped(&sk->sk_v6_daddr))||+(sk->sk_family==AF_INET&&+!ipv6_addr_v4mapped(&entry->addr.addr6)))+#endif+continue;+}+/* avoid any address already in use by subflows and*pendingjoin*/-if(entry->addr.family==((structsock*)msk)->sk_family&&-!lookup_subflow_by_saddr(&msk->conn_list,&entry->addr)){+if(!lookup_subflow_by_saddr(&msk->conn_list,&entry->addr)){ret=entry;break;}
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Mon, 25 Jan 2021 10:58:59 -0800 you wrote:
This patch series from the MPTCP tree adds support for IPv4-mapped IPv6
addressing that was missing when multiple subflows were first
implemented.
Patches 1 and 2 handle the conversion and comparison of the mapped
addresses.
[...]