aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-12-24 18:13:43 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-12-27 19:29:45 +0100
commitfd29d62a9d4e0359f27db0df11803326150e9e56 (patch)
tree326eff5a48a45b286534da350dd4b3ce2a4ac6f8 /tcp.c
parent60925b8b4ed8c597329c6c4933069374e66642b3 (diff)
downloadpasst-fd29d62a9d4e0359f27db0df11803326150e9e56.tar
passt-fd29d62a9d4e0359f27db0df11803326150e9e56.tar.gz
passt-fd29d62a9d4e0359f27db0df11803326150e9e56.tar.bz2
passt-fd29d62a9d4e0359f27db0df11803326150e9e56.tar.lz
passt-fd29d62a9d4e0359f27db0df11803326150e9e56.tar.xz
passt-fd29d62a9d4e0359f27db0df11803326150e9e56.tar.zst
passt-fd29d62a9d4e0359f27db0df11803326150e9e56.zip
tcp: Cast timeval fields to unsigned long long for printing
On x32, glibc defines time_t and suseconds_t (the latter, also known as __syscall_slong_t) as unsigned long long, whereas "everywhere else", including x86_64 and i686, those are unsigned long. See also https://sourceware.org/bugzilla/show_bug.cgi?id=16437 for all the gory details. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tcp.c b/tcp.c
index f506cfd..1e4d2fa 100644
--- a/tcp.c
+++ b/tcp.c
@@ -727,8 +727,9 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn)
it.it_value.tv_sec = ACT_TIMEOUT;
}
- flow_dbg(conn, "timer expires in %lu.%03lus", it.it_value.tv_sec,
- it.it_value.tv_nsec / 1000 / 1000);
+ flow_dbg(conn, "timer expires in %llu.%03llus",
+ (unsigned long long)it.it_value.tv_sec,
+ (unsigned long long)it.it_value.tv_nsec / 1000 / 1000);
timerfd_settime(conn->timer, 0, &it, NULL);
}