From: "ralf_lici (Code Review)" Date: Mon, 16 Feb 2026 13:54:50 +0000 References: Reply-To: ralf@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <6a9f6be850824757c2abc7ca55d4b74f6b3e5b92-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="qGzKclIV4DM="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: management: stop bytecount on client disconnection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --qGzKclIV4DM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1533?usp=3Demail to review the following change. Change subject: management: stop bytecount on client disconnection ...................................................................... management: stop bytecount on client disconnection When a management interface client requests periodic bytecount notifications, openvpn continues to emit them even after the client has disconnected. Additionally, upon reconnecting, the client starts receiving these notifications without having issued a new bytecount command. Stop the periodic bytecount operation when the management interface client disconnects, preventing unnecessary stats polling when using DCO and ensuring that clients only receive notifications they have explicitly requested. Change-Id: I6bdded6c70596b69428e6a00a405ac3cedc405fa Signed-off-by: Ralf Lici --- M src/openvpn/manage.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/33/1533/1 diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index 4ed0393..48b87e9 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -472,6 +472,13 @@ } static void +man_bytecount_stop(struct management *man) +{ + man->connection.bytecount_update_seconds =3D 0; + event_timeout_clear(&man->connection.bytecount_update_interval); +} + +static void man_bytecount(struct management *man, const int update_seconds) { if (update_seconds > 0) @@ -483,8 +490,7 @@ } else { - man->connection.bytecount_update_seconds =3D 0; - event_timeout_clear(&man->connection.bytecount_update_interval); + man_bytecount_stop(man); } /* The newly received bytecount interval may be sooner than the existi= ng @@ -2011,6 +2017,7 @@ { if (socket_defined(man->connection.sd_cli)) { + man_bytecount_stop(man); #ifdef _WIN32 man_stop_ne32(man); #endif -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1533?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: I6bdded6c70596b69428e6a00a405ac3cedc405fa Gerrit-Change-Number: 1533 Gerrit-PatchSet: 1 Gerrit-Owner: ralf_lici Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --qGzKclIV4DM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

ralf_lici would like plaisthos to review this change.

V= iew Change

management: stop bytecount on client discon=
nection

When a management interface client requests periodic bytecou= nt
notifications, openvpn continues to emit them even after the client h= as
disconnected. Additionally, upon reconnecting, the client starts
r= eceiving these notifications without having issued a new bytecount
comma= nd.

Stop the periodic bytecount operation when the management interf= ace
client disconnects, preventing unnecessary stats polling when using = DCO
and ensuring that clients only receive notifications they have
ex= plicitly requested.

Change-Id: I6bdded6c70596b69428e6a00a405ac3cedc4= 05fa
Signed-off-by: Ralf Lici <ralf@...2726...>
---
M src/op= envpn/manage.c
1 file changed, 9 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/chan=
ges/33/1533/1
diff --git a/src/openvpn/manage.c b/src/openvpn/manag=
e.c
index 4ed0393..48b87e9 100644
--- a/src= /openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -472,6 +472,13 @@
}

static void
+man_by= tecount_stop(struct management *man)
+{
+ = man->connection.bytecount_update_seconds =3D 0;
+ event_timeout_clear(&man->conn= ection.bytecount_update_interval);
+}
+
+static void
= man_bytecount(struct management *man, const int update_seconds)

{
if (update_seconds > 0)
@@ -483,8 +490,7 @@
}
else

{
- = man->connection.bytecount_update_seconds =3D 0;
- event_timeout_clear(&man-&g= t;connection.bytecount_update_interval);
+ man_bytecount_stop(man);
= }

/* The newly received bytecount in= terval may be sooner than the existing
@@ -2011,6 +2017,7 @= @
{
if (socket_defined(man->connec= tion.sd_cli))
{
+ man_bytecount_stop(man);
#ifdef _= WIN32
man_stop_ne32(man);
#endif<= /span>

To view, visit change 1533. To unsubscribe,= or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I6bdded6c70596b69428e6a00a40= 5ac3cedc405fa
Gerrit-Change-Number: 1533
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --qGzKclIV4DM=--