Skip to content

Commit 9ab614b

Browse files
committed
Merge branch 'mptcp-handle-late-add_addr-selftests-skip'
Matthieu Baerts says: ==================== mptcp: handle late ADD_ADDR + selftests skip Here are a few independent fixes related to MPTCP and its selftests: - Patch 1: correctly handle ADD_ADDR being received after the switch to 'fully-established'. A fix for another recent fix backported up to v5.14. - Patches 2-5: properly mark some MPTCP Join subtests as 'skipped' if the tested kernel doesn't support the feature being validated. Some fixes for up to v5.13, v5.18, v6.11 and v6.18-rc1 respectively. ==================== Link: https://patch.msgid.link/20251020-net-mptcp-c-flag-late-add-addr-v1-0-8207030cb0e8@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 49d34f3 + a9649df commit 9ab614b

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

net/mptcp/pm_kernel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
370370
}
371371

372372
subflow:
373+
/* No need to try establishing subflows to remote id0 if not allowed */
374+
if (mptcp_pm_add_addr_c_flag_case(msk))
375+
goto exit;
376+
373377
/* check if should create a new subflow */
374378
while (msk->pm.local_addr_used < endp_subflow_max &&
375379
msk->pm.extra_subflows < limit_extra_subflows) {
@@ -401,6 +405,8 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
401405
__mptcp_subflow_connect(sk, &local, &addrs[i]);
402406
spin_lock_bh(&msk->pm.lock);
403407
}
408+
409+
exit:
404410
mptcp_pm_nl_check_work_pending(msk);
405411
}
406412

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,7 @@ laminar_endp_tests()
23242324
{
23252325
# no laminar endpoints: routing rules are used
23262326
if reset_with_tcp_filter "without a laminar endpoint" ns1 10.0.2.2 REJECT &&
2327-
mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
2327+
continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
23282328
pm_nl_set_limits $ns1 0 2
23292329
pm_nl_set_limits $ns2 2 2
23302330
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2336,7 +2336,7 @@ laminar_endp_tests()
23362336

23372337
# laminar endpoints: this endpoint is used
23382338
if reset_with_tcp_filter "with a laminar endpoint" ns1 10.0.2.2 REJECT &&
2339-
mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
2339+
continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
23402340
pm_nl_set_limits $ns1 0 2
23412341
pm_nl_set_limits $ns2 2 2
23422342
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2348,7 +2348,7 @@ laminar_endp_tests()
23482348

23492349
# laminar endpoints: these endpoints are used
23502350
if reset_with_tcp_filter "with multiple laminar endpoints" ns1 10.0.2.2 REJECT &&
2351-
mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
2351+
continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
23522352
pm_nl_set_limits $ns1 0 2
23532353
pm_nl_set_limits $ns2 2 2
23542354
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2363,7 +2363,7 @@ laminar_endp_tests()
23632363

23642364
# laminar endpoints: only one endpoint is used
23652365
if reset_with_tcp_filter "single laminar endpoint" ns1 10.0.2.2 REJECT &&
2366-
mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
2366+
continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
23672367
pm_nl_set_limits $ns1 0 2
23682368
pm_nl_set_limits $ns2 2 2
23692369
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2376,7 +2376,7 @@ laminar_endp_tests()
23762376

23772377
# laminar endpoints: subflow and laminar flags
23782378
if reset_with_tcp_filter "sublow + laminar endpoints" ns1 10.0.2.2 REJECT &&
2379-
mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
2379+
continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
23802380
pm_nl_set_limits $ns1 0 4
23812381
pm_nl_set_limits $ns2 2 4
23822382
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -3939,7 +3939,7 @@ endpoint_tests()
39393939
# subflow_rebuild_header is needed to support the implicit flag
39403940
# userspace pm type prevents add_addr
39413941
if reset "implicit EP" &&
3942-
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
3942+
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
39433943
pm_nl_set_limits $ns1 2 2
39443944
pm_nl_set_limits $ns2 2 2
39453945
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -3964,7 +3964,7 @@ endpoint_tests()
39643964
fi
39653965

39663966
if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
3967-
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
3967+
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
39683968
start_events
39693969
pm_nl_set_limits $ns1 0 3
39703970
pm_nl_set_limits $ns2 0 3
@@ -4040,7 +4040,7 @@ endpoint_tests()
40404040

40414041
# remove and re-add
40424042
if reset_with_events "delete re-add signal" &&
4043-
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
4043+
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
40444044
ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=0
40454045
pm_nl_set_limits $ns1 0 3
40464046
pm_nl_set_limits $ns2 3 3
@@ -4115,7 +4115,7 @@ endpoint_tests()
41154115

41164116
# flush and re-add
41174117
if reset_with_tcp_filter "flush re-add" ns2 10.0.3.2 REJECT OUTPUT &&
4118-
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
4118+
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
41194119
pm_nl_set_limits $ns1 0 2
41204120
pm_nl_set_limits $ns2 1 2
41214121
# broadcast IP: no packet for this address will be received on ns1

0 commit comments

Comments
 (0)