From: claudio Date: Tue, 13 Dec 2022 18:10:55 +0000 (+0000) Subject: In tcp_now() switch from getnsecuptime() to getnsecruntime() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d88352743c468204607aa42025ec3469aacd02bb;p=openbsd 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@ --- 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 */