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@
-/* $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 $ */
/*
static inline uint32_t
tcp_now(void)
{
- return (getnsecuptime() / 1000000);
+ return (getnsecruntime() / 1000000);
}
#define TCP_TIME_MSEC(_ms) (_ms) /* tcp_now() is in milliseconds */