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.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Note: this can go to mptcp-net as well, with the parent patch.
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 13a3b68181ee14eb628a858e5738094c3c936b74..5060b7e24f94550246c2b1f0465dcaf42b869313 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1441,6 +1441,15 @@ chk_join_nr()
fi
fi
+ count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynAckHMacFailure")
+ if [ -z "$count" ]; then
+ rc=${KSFT_SKIP}
+ elif [ "$count" != "0" ]; then
+ rc=${KSFT_FAIL}
+ print_check "ack HMAC"
+ fail_test "got $count JOIN[s] synack HMAC failure expected 0"
+ fi
+
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx")
if [ -z "$count" ]; then
rc=${KSFT_SKIP}
@@ -1450,6 +1459,15 @@ chk_join_nr()
fail_test "got $count JOIN[s] ack rx expected $ack_nr"
fi
+ count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckHMacFailure")
+ if [ -z "$count" ]; then
+ rc=${KSFT_SKIP}
+ elif [ "$count" != "0" ]; then
+ rc=${KSFT_FAIL}
+ print_check "synack HMAC"
+ fail_test "got $count JOIN[s] ack HMAC failure expected 0"
+ fi
+
print_results "join Rx" ${rc}
join_syn_tx="${join_syn_tx:-${syn_nr}}" \
--
2.48.1
Hi Matt, Thanks for this patch. On Sat, 2025-03-29 at 17:26 +0100, Matthieu Baerts (NGI0) wrote: > 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. > > Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> > --- > Note: this can go to mptcp-net as well, with the parent patch. > --- > tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 > ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh > b/tools/testing/selftests/net/mptcp/mptcp_join.sh > index > 13a3b68181ee14eb628a858e5738094c3c936b74..5060b7e24f94550246c2b1f0465 > dcaf42b869313 100755 > --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh > +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh > @@ -1441,6 +1441,15 @@ chk_join_nr() > fi > fi > > + count=$(mptcp_lib_get_counter ${ns2} > "MPTcpExtMPJoinSynAckHMacFailure") > + if [ -z "$count" ]; then > + rc=${KSFT_SKIP} > + elif [ "$count" != "0" ]; then > + rc=${KSFT_FAIL} > + print_check "ack HMAC" Should here be "synack HMAC"... > + fail_test "got $count JOIN[s] synack HMAC failure > expected 0" > + fi > + > count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx") > if [ -z "$count" ]; then > rc=${KSFT_SKIP} > @@ -1450,6 +1459,15 @@ chk_join_nr() > fail_test "got $count JOIN[s] ack rx expected > $ack_nr" > fi > > + count=$(mptcp_lib_get_counter ${ns1} > "MPTcpExtMPJoinAckHMacFailure") > + if [ -z "$count" ]; then > + rc=${KSFT_SKIP} > + elif [ "$count" != "0" ]; then > + rc=${KSFT_FAIL} > + print_check "synack HMAC" ... and here be "ack HMAC"? Thanks, -Geliang > + fail_test "got $count JOIN[s] ack HMAC failure > expected 0" > + fi > + > print_results "join Rx" ${rc} > > join_syn_tx="${join_syn_tx:-${syn_nr}}" \ >
Hi Geliang, On 30/03/2025 01:15, Geliang Tang wrote: > > Hi Matt, > > Thanks for this patch. > > On Sat, 2025-03-29 at 17:26 +0100, Matthieu Baerts (NGI0) wrote: >> 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. >> >> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> >> --- >> Note: this can go to mptcp-net as well, with the parent patch. >> --- >> tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 >> ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh >> b/tools/testing/selftests/net/mptcp/mptcp_join.sh >> index >> 13a3b68181ee14eb628a858e5738094c3c936b74..5060b7e24f94550246c2b1f0465 >> dcaf42b869313 100755 >> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh >> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh >> @@ -1441,6 +1441,15 @@ chk_join_nr() >> fi >> fi >> >> + count=$(mptcp_lib_get_counter ${ns2} >> "MPTcpExtMPJoinSynAckHMacFailure") >> + if [ -z "$count" ]; then >> + rc=${KSFT_SKIP} >> + elif [ "$count" != "0" ]; then >> + rc=${KSFT_FAIL} >> + print_check "ack HMAC" > > Should here be "synack HMAC"... > >> + fail_test "got $count JOIN[s] synack HMAC failure >> expected 0" >> + fi >> + >> count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx") >> if [ -z "$count" ]; then >> rc=${KSFT_SKIP} >> @@ -1450,6 +1459,15 @@ chk_join_nr() >> fail_test "got $count JOIN[s] ack rx expected >> $ack_nr" >> fi >> >> + count=$(mptcp_lib_get_counter ${ns1} >> "MPTcpExtMPJoinAckHMacFailure") >> + if [ -z "$count" ]; then >> + rc=${KSFT_SKIP} >> + elif [ "$count" != "0" ]; then >> + rc=${KSFT_FAIL} >> + print_check "synack HMAC" > > ... and here be "ack HMAC"? Good catch! I can fix that when applying the patches. Cheers, Matt -- Sponsored by the NGI0 Core fund.
© 2016 - 2025 Red Hat, Inc.