From f9a45d148e2d5040cb29b3622771665d57a6bc6b Mon Sep 17 00:00:00 2001 From: Gang Yan Date: Thu, 9 Jan 2025 21:32:32 +0800 Subject: [PATCH] selftests: mptcp: add a testcase for invalid addr timeout This patch adds a timeout testcase, which includes a invalid address within the same LAN, along with another valid address. The invalid address in the LAN triggers a TCP error, leading to an incorrect increment of 'add_addr_accepted'. This test ensures the valid address can still join in this situation. Signed-off-by: Gang Yan --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 6b0705d1084088..80ce8daac2a88e 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2318,6 +2318,20 @@ add_addr_timeout_tests() chk_join_nr 1 1 1 chk_add_nr 8 0 fi + + # signal invalid LAN addresses, which will cause an error at TCP level + if reset_with_add_addr_timeout "invalid LAN address, ADD_ADDR timeout"; then + pm_nl_set_limits $ns1 2 2 + pm_nl_add_endpoint $ns1 10.0.1.3 flags signal + pm_nl_add_endpoint $ns1 10.0.3.1 flags signal + pm_nl_set_limits $ns2 2 2 + + speed=10 \ + run_tests $ns1 $ns2 10.0.1.1 + join_syn_tx=+2 \ + chk_join_nr 1 1 1 + chk_add_nr 8 0 + fi } remove_tests()