Skip to content

Commit 1c2326f

Browse files
matttbePaolo Abeni
authored andcommitted
selftests: mptcp: join: check re-adding init endp with != id
The initial subflow has a special local ID: 0. It is specific per connection. When a global endpoint is deleted and re-added later, it can have a different ID, but the kernel should still use the ID 0 if it corresponds to the initial address. This test validates this behaviour: the endpoint linked to the initial subflow is removed, and re-added with a different ID. Note that removing the initial subflow will not decrement the 'subflows' counters, which corresponds to the *additional* subflows. On the other hand, when the same endpoint is re-added, it will increment this counter, as it will be seen as an additional subflow this time. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 3ad14f5 ("mptcp: more accurate MPC endpoint tracking") Cc: [email protected] Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent dce1c6d commit 1c2326f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,11 +3627,12 @@ endpoint_tests()
36273627
# remove and re-add
36283628
if reset "delete re-add signal" &&
36293629
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
3630-
pm_nl_set_limits $ns1 0 2
3631-
pm_nl_set_limits $ns2 2 2
3630+
pm_nl_set_limits $ns1 0 3
3631+
pm_nl_set_limits $ns2 3 3
36323632
pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
36333633
# broadcast IP: no packet for this address will be received on ns1
36343634
pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal
3635+
pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal
36353636
test_linkfail=4 speed=20 \
36363637
run_tests $ns1 $ns2 10.0.1.1 &
36373638
local tests_pid=$!
@@ -3653,11 +3654,21 @@ endpoint_tests()
36533654
wait_mpj $ns2
36543655
chk_subflow_nr "after re-add" 3
36553656
chk_mptcp_info subflows 2 subflows 2
3657+
3658+
pm_nl_del_endpoint $ns1 42 10.0.1.1
3659+
sleep 0.5
3660+
chk_subflow_nr "after delete ID 0" 2
3661+
chk_mptcp_info subflows 2 subflows 2
3662+
3663+
pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
3664+
wait_mpj $ns2
3665+
chk_subflow_nr "after re-add" 3
3666+
chk_mptcp_info subflows 3 subflows 3
36563667
mptcp_lib_kill_wait $tests_pid
36573668

3658-
chk_join_nr 3 3 3
3659-
chk_add_nr 4 4
3660-
chk_rm_nr 2 1 invert
3669+
chk_join_nr 4 4 4
3670+
chk_add_nr 5 5
3671+
chk_rm_nr 3 2 invert
36613672
fi
36623673

36633674
# flush and re-add

0 commit comments

Comments
 (0)