From bbbde6926e87407ef74e12f28515c2d950927ce1 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Tue, 28 Nov 2023 22:22:25 +0800 Subject: [PATCH] selftests: mptcp: rm subflow with v4/v4mapped addr Now both a v4 address and a v4-mapped address are supported when destroying a userspace pm subflow, this patch adds random tests for both addresses. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index ab0507e7c467e9..19cfe44b35a260 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3304,12 +3304,13 @@ userspace_pm_rm_sf() { local evts=$evts_ns1 local t=${3:-1} - local ip=4 + local ip local tk da dp sp local cnt [ "$1" == "$ns2" ] && evts=$evts_ns2 - if mptcp_lib_is_v6 $2; then ip=6; fi + [ -n "$(mptcp_lib_evts_get_info "saddr4" "$evts" $t)" ] && ip=4 + [ -n "$(mptcp_lib_evts_get_info "saddr6" "$evts" $t)" ] && ip=6 tk=$(mptcp_lib_evts_get_info token "$evts") da=$(mptcp_lib_evts_get_info "daddr$ip" "$evts" $t) dp=$(mptcp_lib_evts_get_info dport "$evts" $t) @@ -3415,7 +3416,7 @@ userspace_tests() userspace_pm_rm_addr $ns1 10 userspace_pm_rm_sf $ns1 ::ffff:10.0.2.1 $SUB_ESTABLISHED else - userspace_pm_rm_sf $ns1 ::ffff:10.0.2.1 $SUB_ESTABLISHED + userspace_pm_rm_sf $ns1 10.0.2.1 $SUB_ESTABLISHED userspace_pm_rm_addr $ns1 10 fi chk_rm_nr 1 1 invert