From d9ba887e9d37b2c5ff012f2abd0776cf93208fba Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Wed, 13 Apr 2016 15:18:38 -0700 Subject: [PATCH] ss: take care of unknown min_rtt Kernel sets info->tcpi_min_rtt to ~0U when no RTT sample was ever taken for the session, thus min_rtt is unknown. Signed-off-by: Eric Dumazet --- misc/ss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c index 544def3f..deefc967 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2019,7 +2019,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, s.segs_out = info->tcpi_segs_out; s.segs_in = info->tcpi_segs_in; s.not_sent = info->tcpi_notsent_bytes; - s.min_rtt = (double) info->tcpi_min_rtt / 1000; + if (info->tcpi_min_rtt && info->tcpi_min_rtt != ~0U) + s.min_rtt = (double) info->tcpi_min_rtt / 1000; tcp_stats_print(&s); free(s.dctcp); } -- 2.39.2