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
---
tcp.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tcp.c b/tcp.c
index 8dabfd30..ce36bbd3 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,
--
2.52.0