]> git.ipfire.org Git - thirdparty/openvpn.git/commit
FreeBSD DCO: repair --inactive
authorGert Doering <gert@greenie.muc.de>
Sun, 9 Nov 2025 08:42:31 +0000 (09:42 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 9 Nov 2025 11:00:32 +0000 (12:00 +0100)
commit7fe5cc03abf2e11bb108dba3117923934dc16150
treec892cecfe03561995da309e09458bf48614047d9
parentce99cd6cfc091e17701b471a88644cb45ab21681
FreeBSD DCO: repair --inactive

--inactive on DCO requires a working DCO counters query function
(dco_get_peer_stats(), implemented in the previous commit) and
that the DCO implementation in use fills the "tun_{read,write}_bytes"
fields for the peer context.

FreeBSD DCO only fills the "dco_{read,write}_bytes" counters - which is
something we can't fix in OpenVPN, this needs kernel enhancements.

So, to make the feature (mostly) work, check the other set of counters
on FreeBSD.  Caveat: this will count encryption overhead and keepalives,
so it will still not work for `--inactive <n>` without a byte count, or
for byte counts with too tight thresholds.

Adding the #ifdef to forward.c was considered the least bad alternative.

v2: fix rst syntax for manpage addition

Github: OpenVPN/openvpn#898

Change-Id: I48c877843d24144450af1282b7524bb3ba18232e
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Ralf Lici <ralf@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1351
Message-Id: <20251109084238.11581-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34274.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/man-sections/client-options.rst
src/openvpn/forward.c