| Message ID | 20250902101628.20568-1-gert@greenie.muc.de |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:2a1c:b0:671:5a2c:6455 with SMTP id
k28csp1851820maz;
Tue, 2 Sep 2025 07:35:59 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AJvYcCVqbv4McOcVmdXgxUHFs61bMl2gRZ1DOAWj1cZZ/UUPmq/NPet8vBTRGiNPf6lIykn/0QB0kdYU+gU=@openvpn.net
X-Google-Smtp-Source:
AGHT+IFy7vcrY69x7HqRWyg7bdu+jf9vZqvoMZizN4KzCUuYtqa4RUsedz5rGzd/lafGuQY6+Vet
X-Received: by 2002:a05:6830:439f:b0:745:52fd:e749 with SMTP id
46e09a7af769-74569ebd157mr5990003a34.25.1756823758924;
Tue, 02 Sep 2025 07:35:58 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1756823758; cv=none;
d=google.com; s=arc-20240605;
b=NIFuxOqN0yNBFH1fOC7DkW872Gpfi5XHBgeAE5/e6vku/CRcWGpkl9kzdSQYLcw6zX
YDcG8zcTF4RrJaAclmjCmTCAAM+GaB3Hw1d+k3SRNX32xu0NfGtDdoENrpoc8Nyp2jzG
cIvEfK722LFou+KJPLsBxEPyQNtiB24Ddged5SKptWT8U1xHpGs4hTwoUQ1FF91rIF9i
7qpw5hZpX64JTpErjS2VB168rZOGhlprDCvA29qwEm4JfDI9jwe64r6UVyc1cf4O3Dl4
dNXSD09SkaHwJsNcajluRVFxo+oXIt67u2MTKyGBuH2ym0w7mdJWeHT8X+aGJC7hEVUR
Ri4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:references:in-reply-to:message-id:date:to:from
:dkim-signature:dkim-signature:dkim-signature;
bh=rPr3j1pQqrkhO8fZPeuXTsPV7uNXPfjPCVqs71RFQgM=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=kQPn4j01Hsgfm6CkFaBqIwZgX4/lFmy+Ug53x3DDnk0zQ0+s5BACaoNGxdI1nnY8LL
UgjqO3ztxVNeJWlbXKVr3Eyse3ROTjj8fHIM7Cd01E9AuNpQ08ggHDFyhQ7vAf/9sczE
tGMbxbrx89C83ATuc8wPKElcuHkB3Ncbzep7A3YeTW933PR62L+yJ4YGr5CkeAah+W/F
9y+vHyPYexa4Z98oKk1BXYUFljUM5KihlzZwiVC4kFuoDmLXbwd3U4Bs3u9yrtYoeLAR
h9GHsFSBuQoyZJbR8EpVSsix32/U64Kp/xXWCkUwKM2SlTTdAyrlZldvUueA4EWSqQZm
21Xg==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=bMUqKZyk;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=Hp8qsc0r;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=TSjARpPW;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
46e09a7af769-745742ef37bsi1552517a34.105.2025.09.02.07.35.58
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Tue, 02 Sep 2025 07:35:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=bMUqKZyk;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=Hp8qsc0r;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=TSjARpPW;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender:
Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;
bh=rPr3j1pQqrkhO8fZPeuXTsPV7uNXPfjPCVqs71RFQgM=; b=bMUqKZykAmI+KBqH/UkxC0//no
IQoFpxhIDSiSocI2Kt1pQc4r/u7mwYrByoVTRdax+JjSW0xgFX/XUqhtwbRxpt1ZGoJcDSBhjn4ZP
CrulJUlPI7kEhzs/Mz2hnM3VwqtOUKTvB8q/TiXtBWq7hMzus6hFxhm3pVDOFE/eGQto=;
Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com)
by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1utS71-0000C4-Nu;
Tue, 02 Sep 2025 14:35:56 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <gert@blue4.greenie.muc.de>) id 1utS6y-0000Bw-NL
for openvpn-devel@lists.sourceforge.net;
Tue, 02 Sep 2025 14:35:53 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References:
In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:
Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=91kxgvJEOyByrS3gemdYmpFqS+bWmEbFLmOEBXYlJHM=; b=Hp8qsc0rSFfpzP977+JOVqCIV2
LXmC+jbgAlAqbR+1Y5qEiHsziVh8Q9/AAbuGJb3LnaRM/+/NxodAdiVMVVNatqIYN0PnbRrKeLjbB
h4j0shlY9Swr5Zh6LiPcpaz7hKo7sIb/PWrMzLozQT/XaxEZ/XanE9aQZD5LAxCtQcEw=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:
Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
List-Post:List-Owner:List-Archive;
bh=91kxgvJEOyByrS3gemdYmpFqS+bWmEbFLmOEBXYlJHM=; b=TSjARpPWzJeJnAIUBYthGHXWak
yI0c9paG46tCw5C5OnQFl55dr93qiBqAmUpJL8+xRa029J431Lzl/VmqlDa/tOZf+1jukP2e+4fvx
HwmjoqRjd7krPSvJm7PVfuqa1LAIi+4lqbsYRO9avJYWE8ZPOELbDkpHnvjtl3NjhW+s=;
Received: from [193.149.48.143] (helo=blue.greenie.muc.de)
by sfi-mx-2.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1utS6y-00085W-No for openvpn-devel@lists.sourceforge.net;
Tue, 02 Sep 2025 14:35:53 +0000
Received: from blue.greenie.muc.de (localhost [127.0.0.1])
by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 582AGSwd020582
for <openvpn-devel@lists.sourceforge.net>; Tue, 2 Sep 2025 12:16:28 +0200
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 582AGSCc020581
for openvpn-devel@lists.sourceforge.net; Tue, 2 Sep 2025 12:16:28 +0200
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Tue, 2 Sep 2025 12:16:22 +0200
Message-ID: <20250902101628.20568-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.49.1
In-Reply-To:
<gerrit.1753449319000.Ic0035d52e0ea123398318870d2f4d21af927a602@gerrit.openvpn.net>
References:
<gerrit.1753449319000.Ic0035d52e0ea123398318870d2f4d21af927a602@gerrit.openvpn.net>
MIME-Version: 1.0
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-1.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: From: Ralf Lici <ralf@mandelbit.com> coarse_timer_wakeup
tracks
when the next timer-driven task will occur. If a user issues `bytecount n`
via the management interface, but the next scheduled wakeup is more than
n seconds away, bandwidth [...]
Content analysis details: (1.3 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Headers-End: 1utS6y-00085W-No
Subject: [Openvpn-devel] [PATCH v4] management: resync timer on bytecount
interval change
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1841796095702215311?=
X-GMAIL-MSGID: =?utf-8?q?1842163230281907531?=
|
| Series |
[Openvpn-devel,v4] management: resync timer on bytecount interval change
|
|
Commit Message
Gert Doering
Sept. 2, 2025, 10:16 a.m. UTC
From: Ralf Lici <ralf@mandelbit.com> coarse_timer_wakeup tracks when the next timer-driven task will occur. If a user issues `bytecount n` via the management interface, but the next scheduled wakeup is more than n seconds away, bandwidth logging will be delayed until that timer fires. To ensure timely logging, reset the timer whenever a new `bytecount` command is received. This guarantees that logging begins exactly n seconds after the command, matching the user-defined interval. Change-Id: Ic0035d52e0ea123398318870d2f4d21af927a602 Signed-off-by: Ralf Lici <ralf@mandelbit.com> Acked-by: Gert Doering <gert@greenie.muc.de> --- 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/+/1113 This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering <gert@greenie.muc.de>
diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index aed04f5..92c5500 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -41,6 +41,7 @@ #include "manage.h" #include "openvpn.h" #include "dco.h" +#include "multi.h" #include "memdbg.h" @@ -513,6 +514,27 @@ man->connection.bytecount_update_seconds = 0; event_timeout_clear(&man->connection.bytecount_update_interval); } + + /* The newly received bytecount interval may be sooner than the existing + * coarse timer wakeup. Reset the timer to ensure it fires at the correct, + * earlier time. + */ + ASSERT(man->persist.callback.arg); + + struct context *c; + + if (man->settings.flags & MF_SERVER) + { + struct multi_context *m = man->persist.callback.arg; + c = &m->top; + } + else + { + c = man->persist.callback.arg; + } + + reset_coarse_timers(c); + msg(M_CLIENT, "SUCCESS: bytecount interval changed"); }