From 696709d74b240088ffeda7f2c72b16e75879c689 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 10 Dec 2025 18:02:56 +1100 Subject: tcp: Correct timer expiry value in trace message 000601ba8 ("tcp: Adaptive interval based on RTT for socket-side acknowledgement checks") added (amongst other things) a new trace message showing the expiry time for the TCP timer in ms rather than s. Unfortunately there were some arithmetic errors in the message, meaning it will print incorrect numbers. Correct them Fixes: 000601ba86da ("tcp: Adaptive interval based on RTT for socket-side acknowledgement checks") Link: https://bugs.passt.top/show_bug.cgi?id=182 Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tcp.c b/tcp.c index 17fda5d..7c721b4 100644 --- a/tcp.c +++ b/tcp.c @@ -626,11 +626,11 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) } if (conn->flags & ACK_TO_TAP_DUE) { - flow_trace(conn, "timer expires in %llu.%03llums", - (unsigned long)it.it_value.tv_sec * 1000 + - (unsigned long long)it.it_value.tv_nsec % - ((long)1000 * 1000), - (unsigned long long)it.it_value.tv_nsec / 1000); + flow_trace(conn, "timer expires in %llu.%02llums", + (unsigned long long)it.it_value.tv_sec * 1000 + + it.it_value.tv_nsec / 1000 / 1000, + (unsigned long long)it.it_value.tv_nsec + / 1000 / 10 % 100); } else { flow_dbg(conn, "timer expires in %llu.%03llus", (unsigned long long)it.it_value.tv_sec, -- cgit v1.2.3