Skip to content

Commit 6767698

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: validate MPJoin HMacFailure counters
The parent commit fixes an issue around these counters where one of them -- MPJoinAckHMacFailure -- was wrongly incremented in some cases. This makes sure the counter is always 0. It should be incremented only in case of corruption, or a wrong implementation, which should not be the case in these selftests. Reviewed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250407-net-mptcp-hmac-failure-mib-v1-2-3c9ecd0a3a50@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 21c02e8 commit 6767698

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,15 @@ chk_join_nr()
14411441
fi
14421442
fi
14431443

1444+
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynAckHMacFailure")
1445+
if [ -z "$count" ]; then
1446+
rc=${KSFT_SKIP}
1447+
elif [ "$count" != "0" ]; then
1448+
rc=${KSFT_FAIL}
1449+
print_check "synack HMAC"
1450+
fail_test "got $count JOIN[s] synack HMAC failure expected 0"
1451+
fi
1452+
14441453
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx")
14451454
if [ -z "$count" ]; then
14461455
rc=${KSFT_SKIP}
@@ -1450,6 +1459,15 @@ chk_join_nr()
14501459
fail_test "got $count JOIN[s] ack rx expected $ack_nr"
14511460
fi
14521461

1462+
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckHMacFailure")
1463+
if [ -z "$count" ]; then
1464+
rc=${KSFT_SKIP}
1465+
elif [ "$count" != "0" ]; then
1466+
rc=${KSFT_FAIL}
1467+
print_check "ack HMAC"
1468+
fail_test "got $count JOIN[s] ack HMAC failure expected 0"
1469+
fi
1470+
14531471
print_results "join Rx" ${rc}
14541472

14551473
join_syn_tx="${join_syn_tx:-${syn_nr}}" \

0 commit comments

Comments
 (0)