Skip to content

Commit

Permalink
selftests: mptcp: more robust signal race test
Browse files Browse the repository at this point in the history
The in kernel MPTCP PM implementation can process a single
incoming add address option at any given time. In the
mentioned test the server can surpas such limit. Let the
setup cope with that allowing a faster add_addr retransmission.

Fixes: a88c9e4 ("mptcp: do not block subflows creation on errors")
Fixes: f7efc77 ("mptcp: drop argument port from mptcp_pm_announce_addr")
Closes: #254
Reported-and-tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Paolo Abeni authored and matttbe committed Feb 11, 2022
1 parent 0cca9ec commit eb99314
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -892,11 +892,17 @@ chk_add_nr()
local mis_ack_nr=${8:-0}
local count
local dump_stats
local timeout

timeout=`ip netns exec $ns1 sysctl -n net.mptcp.add_addr_timeout`

printf "%-39s %s" " " "add"
count=`ip netns exec $ns2 nstat -as | grep MPTcpExtAddAddr | awk '{print $2}'`
count=`ip netns exec $ns2 nstat -as MPTcpExtAddAddr | grep MPTcpExtAddAddr | awk '{print $2}'`
[ -z "$count" ] && count=0
if [ "$count" != "$add_nr" ]; then

# if the test configured a short timeout tolerate greater then expected
# add addrs options, due to retransmissions
if [ "$count" != "$add_nr" ] && [ "$timeout" -gt 1 -o "$count" -lt "$add_nr" ]; then
echo "[fail] got $count ADD_ADDR[s] expected $add_nr"
ret=1
dump_stats=1
Expand Down Expand Up @@ -1288,6 +1294,7 @@ signal_address_tests()

# signal addresses race test
reset

pm_nl_set_limits $ns1 4 4
pm_nl_set_limits $ns2 4 4
pm_nl_add_endpoint $ns1 10.0.1.1 flags signal
Expand All @@ -1298,7 +1305,10 @@ signal_address_tests()
pm_nl_add_endpoint $ns2 10.0.2.2 flags signal
pm_nl_add_endpoint $ns2 10.0.3.2 flags signal
pm_nl_add_endpoint $ns2 10.0.4.2 flags signal
run_tests $ns1 $ns2 10.0.1.1

# the peer could possibly miss some addr notification, allow retransmission
ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=1
run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow
chk_join_nr "signal addresses race test" 3 3 3

# the server will not signal the address terminating
Expand Down

0 comments on commit eb99314

Please sign in to comment.