Skip to content

Commit e06959e

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: join: test for flush/re-add endpoints
After having flushed endpoints that didn't cause the creation of new subflows, it is important to check endpoints can be re-created, re-using previously used IDs. Before the previous commit, the client would not have been able to re-create the subflow that was previously rejected. 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: 06faa22 ("mptcp: remove multi addresses and subflows in PM") Cc: [email protected] Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ef34a6e commit e06959e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,36 @@ endpoint_tests()
36513651
chk_rm_nr 2 1 invert
36523652
fi
36533653

3654+
# flush and re-add
3655+
if reset_with_tcp_filter "flush re-add" ns2 10.0.3.2 REJECT OUTPUT &&
3656+
mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
3657+
pm_nl_set_limits $ns1 0 2
3658+
pm_nl_set_limits $ns2 1 2
3659+
# broadcast IP: no packet for this address will be received on ns1
3660+
pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal
3661+
pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow
3662+
test_linkfail=4 speed=20 \
3663+
run_tests $ns1 $ns2 10.0.1.1 &
3664+
local tests_pid=$!
3665+
3666+
wait_attempt_fail $ns2
3667+
chk_subflow_nr "before flush" 1
3668+
chk_mptcp_info subflows 0 subflows 0
3669+
3670+
pm_nl_flush_endpoint $ns2
3671+
pm_nl_flush_endpoint $ns1
3672+
wait_rm_addr $ns2 0
3673+
ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJECT
3674+
pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow
3675+
wait_mpj $ns2
3676+
pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal
3677+
wait_mpj $ns2
3678+
mptcp_lib_kill_wait $tests_pid
3679+
3680+
chk_join_nr 2 2 2
3681+
chk_add_nr 2 2
3682+
chk_rm_nr 1 0 invert
3683+
fi
36543684
}
36553685

36563686
# [$1: error message]

0 commit comments

Comments
 (0)