Re: [RFC ovpn net] ovpn: use monotonic clock for peer keepalive timeouts

Antonio Quartulli <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
Hi Marco,

On 29/05/2026 15:15, Marco Baffo wrote:
> Replace ktime_get_real_seconds() with the monotonic ktime_get_boottime_seconds()
> to ensure the keepalive mechanism is robust against system clock modifications.
> 
> Right now, the driver uses ktime_get_real_seconds() to track peer timeouts,
> relying on the system wall-clock.
> 
> An administrative time adjustment or an NTP sync that steps the clock forward
> can cause `now' to instantly exceed `last_recv + timeout'.
> 
> When this occurs, the driver artificially expires healthy peers. Depending on
> the OpenVPN user-space configuration, this triggers a premature tunnel restart
> (if --keepalive or --ping-restart is used) or a complete disconnection of the
> client (if --ping-exit is used).
> 
> Signed-off-by: Marco Baffo <[email protected]>

This looks good. Please send it as PATCH so that I can queue it for 
sending to net.

Cheers,



-- 
Antonio Quartulli
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.