Skip to content

Commit 5f94b08

Browse files
matttbePaolo Abeni
authored andcommitted
selftests: mptcp: join: check removing ID 0 endpoint
Removing the endpoint linked to the initial subflow should trigger a RM_ADDR for the right ID, and the removal of the subflow. That's what is now being verified in the "delete and re-add" test. 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: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 87b5896 commit 5f94b08

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3572,8 +3572,9 @@ endpoint_tests()
35723572

35733573
if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
35743574
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
3575-
pm_nl_set_limits $ns1 0 2
3576-
pm_nl_set_limits $ns2 0 2
3575+
pm_nl_set_limits $ns1 0 3
3576+
pm_nl_set_limits $ns2 0 3
3577+
pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
35773578
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
35783579
test_linkfail=4 speed=20 \
35793580
run_tests $ns1 $ns2 10.0.1.1 &
@@ -3582,17 +3583,17 @@ endpoint_tests()
35823583
wait_mpj $ns2
35833584
pm_nl_check_endpoint "creation" \
35843585
$ns2 10.0.2.2 id 2 flags subflow dev ns2eth2
3585-
chk_subflow_nr "before delete" 2
3586+
chk_subflow_nr "before delete id 2" 2
35863587
chk_mptcp_info subflows 1 subflows 1
35873588

35883589
pm_nl_del_endpoint $ns2 2 10.0.2.2
35893590
sleep 0.5
3590-
chk_subflow_nr "after delete" 1
3591+
chk_subflow_nr "after delete id 2" 1
35913592
chk_mptcp_info subflows 0 subflows 0
35923593

35933594
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
35943595
wait_mpj $ns2
3595-
chk_subflow_nr "after re-add" 2
3596+
chk_subflow_nr "after re-add id 2" 2
35963597
chk_mptcp_info subflows 1 subflows 1
35973598

35983599
pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow
@@ -3607,10 +3608,20 @@ endpoint_tests()
36073608
chk_subflow_nr "after no reject" 3
36083609
chk_mptcp_info subflows 2 subflows 2
36093610

3611+
pm_nl_del_endpoint $ns2 1 10.0.1.2
3612+
sleep 0.5
3613+
chk_subflow_nr "after delete id 0" 2
3614+
chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf
3615+
3616+
pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
3617+
wait_mpj $ns2
3618+
chk_subflow_nr "after re-add id 0" 3
3619+
chk_mptcp_info subflows 3 subflows 3
3620+
36103621
mptcp_lib_kill_wait $tests_pid
36113622

3612-
chk_join_nr 3 3 3
3613-
chk_rm_nr 1 1
3623+
chk_join_nr 4 4 4
3624+
chk_rm_nr 2 2
36143625
fi
36153626

36163627
# remove and re-add

0 commit comments

Comments
 (0)