From: Eric Dumazet Date: Fri, 3 Apr 2026 10:23:09 +0000 (+0000) Subject: ss: add support for TCP delack timers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37c010d59a44beff3f49f3e4cbd49dbd5ba1fb8d;p=thirdparty%2Fiproute2.git ss: add support for TCP delack timers Kernel commit c698f5cc940d ("inet_diag: report delayed ack timer information") added a new enum for idiag_timer values and support for delayed ack timers. Change tcp_timer_print() to use the new enum and display "delack" instead of "unknown": tt -to ... ESTAB 10 0 [2002:a05:6830:1f86::]:12875 [2002:a05:6830:1f85::]:50438 timer:(delack,003ms,0) ino:152178 sk:3004 cgroup:unreachable:189 <-> skmem:(r1344,rb12780520,t0,tb262144,f2752,w0,o250,bl0,d0) ts usec_ts ... Signed-off-by: Eric Dumazet Reviewed-by: Neal Cardwell Signed-off-by: David Ahern --- diff --git a/misc/ss.c b/misc/ss.c index b3566f6b..1ea804ad 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2765,21 +2765,23 @@ static void tcp_stats_print(struct tcpstat *s) static void tcp_timer_print(struct tcpstat *s) { static const char * const tmr_name[] = { - "off", - "on", - "keepalive", - "timewait", - "persist", - "unknown" + [IDIAG_TIMER_OFF] = "off", + [IDIAG_TIMER_ON] = "on", + [IDIAG_TIMER_KEEPALIVE] = "keepalive", + [IDIAG_TIMER_TIMEWAIT] = "timewait", + [IDIAG_TIMER_PROBE0] = "persist", + [IDIAG_TIMER_DELACK] = "delack", }; if (s->timer) { - if (s->timer > 4) - s->timer = 5; - out(" timer:(%s,%s,%d)", - tmr_name[s->timer], - print_ms_timer(s->timeout), - s->retrans); + const char *name; + + if (s->timer >= ARRAY_SIZE(tmr_name)) + name = "unknown"; + else + name = tmr_name[s->timer]; + out(" timer:(%s,%s,%d)", name, + print_ms_timer(s->timeout), s->retrans); } }