[Openvpn-devel,v2] dco-freebsd: store peer stats directly in c2

Message ID 20251017205618.8273-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v2] dco-freebsd: store peer stats directly in c2 | expand

Commit Message

Gert Doering Oct. 17, 2025, 8:56 p.m. UTC
From: Ralf Lici <ralf@mandelbit.com>

The dco_context_t structure includes a reference to the general context
structure c, which allows us to store dco_read_bytes and dco_write_bytes
directly as c2 fields. This aligns the FreeBSD implementation with how
we handle DCO peer stats on Linux and Windows.

Change-Id: I53dd40fabdeacb9dca843e28fdd3b357711c5a84
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1275
---

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

Acked-by according to Gerrit (reflected above):

Patch

diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c
index 947a769..f7ed02f 100644
--- a/src/openvpn/dco_freebsd.c
+++ b/src/openvpn/dco_freebsd.c
@@ -621,8 +621,8 @@ 
             {
                 const nvlist_t *bytes = nvlist_get_nvlist(nvl, "bytes");
 
-                dco->dco_read_bytes = nvlist_get_number(bytes, "in");
-                dco->dco_write_bytes = nvlist_get_number(bytes, "out");
+                dco->c->c2.dco_read_bytes = nvlist_get_number(bytes, "in");
+                dco->c->c2.dco_write_bytes = nvlist_get_number(bytes, "out");
             }
 
             dco->dco_message_type = OVPN_CMD_DEL_PEER;