aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/tcp_ao/connect.c
diff options
context:
space:
mode:
authorMohammad Nassiri <mnassiri@ciena.com>2024-08-23 23:04:56 +0100
committerJakub Kicinski <kuba@kernel.org>2024-08-27 14:11:27 -0700
commit1c69e1f433990a81b5a5d415d8892ebcaacb985b (patch)
tree8568f7dc9230efd052d0cd3ef67759d33421752f /tools/testing/selftests/net/tcp_ao/connect.c
parentselftests/net: Don't forget to close nsfd after switch_save_ns() (diff)
downloadlinux-1c69e1f433990a81b5a5d415d8892ebcaacb985b.tar.gz
linux-1c69e1f433990a81b5a5d415d8892ebcaacb985b.zip
selftests/tcp_ao: Fix printing format for uint64_t
It's not safe to use '%zu' specifier for printing uint64_t on 32-bit systems. For uint64_t, we should use the 'PRIu64' macro from the inttypes.h library. This ensures that the uint64_t is printed correctly from the selftests regardless of the system architecture. Signed-off-by: Mohammad Nassiri <mnassiri@ciena.com> [Added missing spaces in fail/ok messages and uint64_t cast in setsockopt-closed, as otherwise it was giving warnings on 64bit. And carried it to netdev ml] Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://patch.msgid.link/20240823-tcp-ao-selftests-upd-6-12-v4-6-05623636fe8c@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/tcp_ao/connect.c')
-rw-r--r--tools/testing/selftests/net/tcp_ao/connect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/tcp_ao/connect.c b/tools/testing/selftests/net/tcp_ao/connect.c
index 81653b47f303..9eecc4a1072e 100644
--- a/tools/testing/selftests/net/tcp_ao/connect.c
+++ b/tools/testing/selftests/net/tcp_ao/connect.c
@@ -67,14 +67,14 @@ static void *client_fn(void *arg)
netstat_free(ns_after);
if (nr_packets > (after_aogood - before_aogood)) {
- test_fail("TCPAOGood counter mismatch: %zu > (%zu - %zu)",
+ test_fail("TCPAOGood counter mismatch: %zu > (%" PRIu64 " - %" PRIu64 ")",
nr_packets, after_aogood, before_aogood);
return NULL;
}
if (test_tcp_ao_counters_cmp("connect", &ao1, &ao2, TEST_CNT_GOOD))
return NULL;
- test_ok("connect TCPAOGood %" PRIu64 "/%" PRIu64 "/%" PRIu64 " => %" PRIu64 "/%" PRIu64 "/%" PRIu64 ", sent %" PRIu64,
+ test_ok("connect TCPAOGood %" PRIu64 "/%" PRIu64 "/%" PRIu64 " => %" PRIu64 "/%" PRIu64 "/%" PRIu64 ", sent %zu",
before_aogood, ao1.ao_info_pkt_good,
ao1.key_cnts[0].pkt_good,
after_aogood, ao2.ao_info_pkt_good,