[Openvpn-devel,v1] dco_linux: allow passing KEEPALIVE_TIMEOUT without KEEPALIVE_INTERVAL

Message ID 20260605181053.3774-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] dco_linux: allow passing KEEPALIVE_TIMEOUT without KEEPALIVE_INTERVAL |

Commit Message

Gert Doering June 5, 2026, 6:10 p.m. UTC
  From: Marco Baffo <marco@mandelbit.com>

Depends on: https://github.com/OpenVPN/ovpn-net-next/commit/67f453e3146a646ef5f811e5a85c610537d80521

Closes: https://github.com/OpenVPN/openvpn/issues/911

Change-Id: Ib56fb53ec1c0c30c9aecbd0ca440de2affad04b5
Signed-off-by: Marco Baffo <marco@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1705
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1705
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Comments

Gert Doering June 7, 2026, 4:50 p.m. UTC | #1
On the userland side, this is fairly trivial and straightforward - when
deciding whether to call dco_set_peer(), take "ping_rec_timeout" into
account (which gets set by "ping-restart" and "ping-exit").  The more
interesting change is kernel-side, to decouple "ping" and "ping-restart"
settings (but that's a different patch for different people to review).

Stared-at-code, test compiled on Linux.

Applying this to release/2.7 as well, because it is very much non-intrusive,
and people have stumbled across this (so "mini bugfix").

Your patch has been applied to the master and release/2.7 branch.

commit d66de4e0a461c8cc5fff5a00ec14b41dd27fc365 (master)
commit 4b49192f980a7a8fb63c74b30c2be631aaa2eb38 (release/2.7)
Author: Marco Baffo
Date:   Fri Jun 5 20:10:46 2026 +0200

     dco_linux: allow passing KEEPALIVE_TIMEOUT without KEEPALIVE_INTERVAL

     Signed-off-by: Marco Baffo <marco@mandelbit.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1705
     Message-Id: <20260605181053.3774-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37070.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index d332359c..0998bd6 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -1623,9 +1623,9 @@ 
 
     if (dco_enabled(options))
     {
-        /* dco_set_peer() must be called if either keepalive or
-         * mssfix are set to update in-kernel config */
-        if (options->ping_send_timeout || frame->mss_fix)
+        /* dco_set_peer() must be called if either keepalive, ping, ping-restart,
+         * ping-exit or mssfix are set to update in-kernel config */
+        if (options->ping_send_timeout || options->ping_rec_timeout || frame->mss_fix)
         {
             int ret = dco_set_peer(dco, multi->dco_peer_id, options->ping_send_timeout,
                                    options->ping_rec_timeout, frame->mss_fix);