]> 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:09:54 +0000 (13:09 +0100)
commit514eefb14ace41a5790e59b81654d1d5eed60670
treeb5037cdc24551adfebf32ff87c1599831a9e9581
parent0267649a21a2af1b60fbddcb78b0ed642080d6fd
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>
src/openvpn/dco_win.c
src/openvpn/forward.c