]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Support --inactive option for DCO
authorLev Stipakov <lev@openvpn.net>
Wed, 15 Mar 2023 13:38:08 +0000 (15:38 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 17 Mar 2023 12:10:44 +0000 (13:10 +0100)
commitfd71bce651d5f606d3c1d430c7c0911fe119f075
tree622554c55d617d791a2f9686000aeade60206b15
parentf970ad99a1a1f30d091853b111e678dbdc3dede9
Support --inactive option for DCO

When DCO is in use, userland doesn't see any traffic
which breaks --inactive option.

Fix by adding inactivity check to inactivity timeout
callback. Get the cumulative tun bytes count (ping packets
are excluded) from DCO and compare it to the previous value
stored in c2.inactivity_bytes. Reset inactivity timer and
update c2.inactivity_bytes if amount of new bytes exceeds
inactivity_minimum_bytes, otherwise terminate session
due to inactivity.

Github: Fixes OpenVPN/openvpn#228

Currently works only on Windows, since we don't yet have
single peer stats implementation for Linux and FreeBSD.

Change-Id: Ib417b965bc4a2c17b51935b43c9627b106716526
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Heiko Hund <heiko@ist.eigentlich.net>
Message-Id: <20230315133808.1550-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26421.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 514eefb14ace41a5790e59b81654d1d5eed60670)
src/openvpn/dco_win.c
src/openvpn/forward.c