aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/tcp_ao/connect-deny.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-deny.c
parenta9e1693406f96f3739611dd08518c9eda3acecfd (diff)
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-deny.c')
-rw-r--r--tools/testing/selftests/net/tcp_ao/connect-deny.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/tcp_ao/connect-deny.c b/tools/testing/selftests/net/tcp_ao/connect-deny.c
index 185a2f6e5ff3..5691f3d00603 100644
--- a/tools/testing/selftests/net/tcp_ao/connect-deny.c
+++ b/tools/testing/selftests/net/tcp_ao/connect-deny.c
@@ -84,10 +84,10 @@ static void try_accept(const char *tst_name, unsigned int port, const char *pwd,
after_cnt = netstat_get_one(cnt_name, NULL);
if (after_cnt <= before_cnt) {
- test_fail("%s: %s counter did not increase: %zu <= %zu",
+ test_fail("%s: %s counter did not increase: %" PRIu64 " <= %" PRIu64,
tst_name, cnt_name, after_cnt, before_cnt);
} else {
- test_ok("%s: counter %s increased %zu => %zu",
+ test_ok("%s: counter %s increased %" PRIu64 " => %" PRIu64,
tst_name, cnt_name, before_cnt, after_cnt);
}