aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2025-12-10 18:02:56 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-12-10 08:37:06 +0100
commit696709d74b240088ffeda7f2c72b16e75879c689 (patch)
tree277941672182b5cee6cf007abd875b35c49f4975
parentc3f1ba70237a9e66822aff3aa5765d0adf6f6307 (diff)
downloadpasst-696709d74b240088ffeda7f2c72b16e75879c689.tar
passt-696709d74b240088ffeda7f2c72b16e75879c689.tar.gz
passt-696709d74b240088ffeda7f2c72b16e75879c689.tar.bz2
passt-696709d74b240088ffeda7f2c72b16e75879c689.tar.lz
passt-696709d74b240088ffeda7f2c72b16e75879c689.tar.xz
passt-696709d74b240088ffeda7f2c72b16e75879c689.tar.zst
passt-696709d74b240088ffeda7f2c72b16e75879c689.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tcp.c10
1 files 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,