From d88352743c468204607aa42025ec3469aacd02bb Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 13 Dec 2022 18:10:55 +0000 Subject: [PATCH] In tcp_now() switch from getnsecuptime() to getnsecruntime() The tcp timer is not supposed to run during suspend but getnsecuptime() does and because of this sessions with TCP_KEEPALIVE on reset after a few hours of sleep. Problem noticed by mlarkin@, investigation by yasuoka@ additional testing jca@ OK yasuoka@ jca@ cheloha@ --- sys/netinet/tcp_var.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index eb5023052f9..e4931ab441d 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_var.h,v 1.161 2022/11/07 11:22:55 yasuoka Exp $ */ +/* $OpenBSD: tcp_var.h,v 1.162 2022/12/13 18:10:55 claudio Exp $ */ /* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */ /* @@ -641,7 +641,7 @@ tcpstat_pkt(enum tcpstat_counters pcounter, enum tcpstat_counters bcounter, static inline uint32_t tcp_now(void) { - return (getnsecuptime() / 1000000); + return (getnsecruntime() / 1000000); } #define TCP_TIME_MSEC(_ms) (_ms) /* tcp_now() is in milliseconds */ -- 2.20.1