From: "cron2 (Code Review)" Date: Tue, 28 Oct 2025 11:46:18 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., marco@...2726..., openvpn-devel@lists.sourceforge.net, ralf@...2726..., frank@...2641... Message-ID: <9a7cfa2a8dd4e4d9d9329d6c2116eb646fb5c0b0-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="RC1a2L2Vl9U="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: dco-freebsd: fix peer stats storage on client instances List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ralf_lici , plaisthos , flichtenheld , mrbff Cc: openvpn-devel --RC1a2L2Vl9U= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= ralf_lici. ( http://gerrit.openvpn.net/c/openvpn/+/1290?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+1 by mrbff, Code-Review+2 by cron2 Change subject: dco-freebsd: fix peer stats storage on client instances ...................................................................... dco-freebsd: fix peer stats storage on client instances Commit bf01a96 introduced a bug in the dco-freebsd path by attempting to store peer statistics in a structure that only exists on server instances. This leads to a SIGSEGV on non-server instances due to a NULL multi_context pointer. Resolve this by checking what mode the current instance is running in and storing peer stats accordingly. Fixes: https://github.com/OpenVPN/openvpn/issues/875 Change-Id: I92b5f3996f2a2180fa5e94719603078c1fc2f7f6 Signed-off-by: Ralf Lici Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1290 Message-Id: <20251028113310.19921-1-gert@...1296...> Signed-off-by: Gert Doering --- M src/openvpn/dco_freebsd.c 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/1290/2 diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index e51f8dd..3521fca 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -634,7 +634,17 @@ if (nvlist_exists_nvlist(nvl, "bytes")) { - dco_update_peer_stat(dco->c->multi, dco->dco_message_peer_= id, nvlist_get_nvlist(nvl, "bytes")); + const nvlist_t *bytes =3D nvlist_get_nvlist(nvl, "bytes"); + + if (dco->c->mode =3D=3D CM_TOP) + { + dco_update_peer_stat(dco->c->multi, dco->dco_message_p= eer_id, bytes); + } + else + { + dco->c->c2.dco_read_bytes =3D nvlist_get_number(bytes,= "in"); + dco->c->c2.dco_write_bytes =3D nvlist_get_number(bytes= , "out"); + } } dco->dco_message_type =3D OVPN_CMD_DEL_PEER; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1290?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I92b5f3996f2a2180fa5e94719603078c1fc2f7f6 Gerrit-Change-Number: 1290 Gerrit-PatchSet: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: mrbff Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --RC1a2L2Vl9U= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by ralf_lici.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+1 by mrbff, Code-Review+2 by cron2

dco-freebsd=
: fix peer stats storage on client instances

Commit bf01a96 introduc= ed a bug in the dco-freebsd path by attempting to
store peer statistics = in a structure that only exists on server
instances. This leads to a SIG= SEGV on non-server instances due to a NULL
multi_context pointer.
Resolve this by checking what mode the current instance is running in
a= nd storing peer stats accordingly.

Fixes: https://github.com/OpenVPN= /openvpn/issues/875
Change-Id: I92b5f3996f2a2180fa5e94719603078c1fc2f7f6=
Signed-off-by: Ralf Lici <ralf@...2726...>
Acked-by: Gert Doer= ing <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/ope= nvpn/+/1290
Message-Id: <20251028113310.19921-1-gert@...1296...>Signed-off-by: Gert Doering <gert@...1296...>
---
M src/openv= pn/dco_freebsd.c
1 file changed, 11 insertions(+), 1 deletion(-)

=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/ch=
anges/90/1290/2
diff --git a/src/openvpn/dco_freebsd.c b/src/openvp=
n/dco_freebsd.c
index e51f8dd..3521fca 100644
--- a/src/openvpn/dco_freebsd.c
+++ b/src/openvpn/dco_fr= eebsd.c
@@ -634,7 +634,17 @@

if (nvlist_exists_nvlist(nvl, "bytes")) {
= - dco_update_peer_stat(dco->c->multi, dco->dco_mess= age_peer_id, nvlist_get_nvlist(nvl, "bytes"));
+ const nvlist_t *bytes = =3D nvlist_get_nvlist(nvl, "bytes");
+
+ if (dco->c->mode =3D=3D CM_TOP)
+ {
+ dco_update_peer= _stat(dco->c->multi, dco->dco_message_peer_id, bytes);
<= span style=3D"color: hsl(120, 100%, 40%);">+ }
+ else
+ {
+ dco->c->= c2.dco_read_bytes =3D nvlist_get_number(bytes, "in");
<= span style=3D"color: hsl(120, 100%, 40%);">+ dco->c-&= gt;c2.dco_write_bytes =3D nvlist_get_number(bytes, "out");=
+ } }

dco-&= gt;dco_message_type =3D OVPN_CMD_DEL_PEER;

To view, visit change 1290. To unsubscribe, or for help writing mail filter= s, visit setting= s.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I92b5f3996f2a2180fa5e9471960= 3078c1fc2f7f6
Gerrit-Change-Number: 1290
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: mrbff <marco@...2726...>= ;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --RC1a2L2Vl9U=--