Skip to content

Commit 44efebe

Browse files
Paolo Abenigregkh
authored andcommitted
selftests: mptcp: be more conservative with cookie MPJ limits
commit e35f885 upstream. Since commit 2843ff6 ("mptcp: remote addresses fullmesh"), an MPTCP client can attempt creating multiple MPJ subflow simultaneusly. In such scenario the server, when syncookies are enabled, could end-up accepting incoming MPJ syn even above the configured subflow limit, as the such limit can be enforced in a reliable way only after the subflow creation. In case of syncookie, only after the 3rd ack reception. As a consequence the related self-tests case sporadically fails, as it verify that the server always accept the expected number of MPJ syn. Address the issues relaxing the MPJ syn number constrain. Note that the check on the accepted number of MPJ 3rd ack still remains intact. Fixes: 2843ff6 ("mptcp: remote addresses fullmesh") Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b52841a commit 44efebe

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ chk_join_nr()
624624
local ack_nr=$4
625625
local count
626626
local dump_stats
627+
local with_cookie
627628

628629
printf "%02u %-36s %s" "$TEST_COUNT" "$msg" "syn"
629630
count=`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinSynRx | awk '{print $2}'`
@@ -637,12 +638,20 @@ chk_join_nr()
637638
fi
638639

639640
echo -n " - synack"
641+
with_cookie=`ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies`
640642
count=`ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinSynAckRx | awk '{print $2}'`
641643
[ -z "$count" ] && count=0
642644
if [ "$count" != "$syn_ack_nr" ]; then
643-
echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr"
644-
ret=1
645-
dump_stats=1
645+
# simult connections exceeding the limit with cookie enabled could go up to
646+
# synack validation as the conn limit can be enforced reliably only after
647+
# the subflow creation
648+
if [ "$with_cookie" = 2 ] && [ "$count" -gt "$syn_ack_nr" ] && [ "$count" -le "$syn_nr" ]; then
649+
echo -n "[ ok ]"
650+
else
651+
echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr"
652+
ret=1
653+
dump_stats=1
654+
fi
646655
else
647656
echo -n "[ ok ]"
648657
fi

0 commit comments

Comments
 (0)