[Openvpn-devel,v1] dco: always print the status block

Message ID 20261117104537.317440-1-tommaso.bailetti@nethesis.it
State New
Headers
Series [Openvpn-devel,v1] dco: always print the status block |

Commit Message

Tommaso Bailetti Nov. 17, 2026, 10:45 a.m. UTC
  When DCO is enabled print_status() bails out if dco_get_peer_stats()
fails, without writing anything. On a client this happens during the
whole reconnect after a ping-restart, since there's no DCO interface,
so the management "status" command never gets an answer, not even
"END", and the --status file isn't updated either.

Print the status anyway. On a real DCO error SIGUSR1 is still raised
by dco_get_peer_stats(), so the session restart keeps working.

GitHub: closes OpenVPN/openvpn#1146
Change-Id: I831224f06e2f35bfcc9d0fec7d8edfc344c59406
Signed-off-by: Tommaso Bailetti <tommaso.bailetti@nethesis.it>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2201
---

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/+/2201
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Antonio Quartulli <antonio@mandelbit.com>
  

Patch

diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c
index 0cdb01a..8ea756c 100644
--- a/src/openvpn/sig.c
+++ b/src/openvpn/sig.c
@@ -483,10 +483,7 @@ 
 
     if (dco_enabled(&c->options))
     {
-        if (dco_get_peer_stats(c, true) < 0)
-        {
-            return;
-        }
+        dco_get_peer_stats(c, true);
     }
 
     status_printf(so, "OpenVPN STATISTICS");