From f931a8703c7b9d421ded01636cd201bc3c466da5 Mon Sep 17 00:00:00 2001 From: Berik Ashimov Date: Fri, 18 Sep 2026 14:10:41 +0500 Subject: openvpn: T9334: stop rendering "keepalive 0 0" An interval of 0 is how the CLI turns keepalive off, and it rendered "keepalive 0 0" because OpenVPN skipped its own sanity checks on that pair. OpenVPN 2.7.6 dropped the exception and now refuses to start: "keepalive ping: Must be an integer between 1 and 86400, not 0". Leave the directive out of the file instead. Nothing then sets ping or ping-restart, which is the keepalive-off the interval asked for, and a saved configuration still commits untouched. --- src/conf_mode/interfaces_openvpn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/conf_mode/interfaces_openvpn.py b/src/conf_mode/interfaces_openvpn.py index 2b235c057..3cf416c3c 100755 --- a/src/conf_mode/interfaces_openvpn.py +++ b/src/conf_mode/interfaces_openvpn.py @@ -542,9 +542,8 @@ def verify(openvpn): failure_count = int(keep_alive['failure_count']) timeout = interval * failure_count - # A zero interval renders "keepalive 0 0", on which OpenVPN skips its - # own sanity checks - that is how a configuration turns keepalive off, - # so only an enabled one has to satisfy them + # A zero interval turns keepalive off and renders no directive at + # all, so only an enabled one has to satisfy them if interval > 0: # the timeout has to be at least twice the interval, which the CLI # ranges do not enforce -- cgit v1.2.3