From patchwork Mon Dec 15 15:04:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4684 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:1490:b0:7b1:439f:bdf with SMTP id bf16csp1875512mac; Mon, 15 Dec 2025 07:05:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVGqb2UZTAAUbeXB6Fyb6zP+aGDaCNRxbdDwPuz7OAL1PJRtwkbWgfS/YlrSTiITXDY1hu0EVEA2MI=@openvpn.net X-Google-Smtp-Source: AGHT+IEczWDKvj9dwI7w2dHMq+NBLuqEOfQiIoBj4yTS6SlnoxUgiHnZBlepdLTyFBsge83prPaB X-Received: by 2002:a05:6830:679b:b0:745:4823:df18 with SMTP id 46e09a7af769-7cae8374cc2mr4865565a34.28.1765811117322; Mon, 15 Dec 2025 07:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1765811117; cv=none; d=google.com; s=arc-20240605; b=ZYbhntUM82On9ioYA70UvCscPpDGDbX8tHTYPlU/f3lWJ0ziCPue3xIkyySUCidht1 hCYxkddKjnsI1EqTdTgWsjo1gdc5OZkmLy7F4/y3eKYH0oJ5l5FK+imRcnIF4Jdo4l+V rlVgfhSpS+XzUni1NkvXtWvx1lA1Sii7DatyVMeL5nCrFLQTFgQAWnuhbZgyRqyAxCH6 qQLqlzRGFxnwwNkre0bbdh8sVhmkZmznLIhNm4J8v+mBK+j9tQRvZNZ5EdBFRc76x4r9 jIC3i046KQzWvygR4urHPeyIbc6EqmQAEXBn9CgYxxN1V7w8zUDyrCrGIhYGAE1dT8Ng 6Qew== 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=XVCv/62qVqsvldsDCaJFSBQ37+XeQPYSHcbDIy/gb7U=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Yg8Lb9g8LisnCeMW8KDm7vleccIThB6SYUFTiUmVth4kzof+lQm/QlB3q3B/+ScQdT xr5le78oiid1p1brG48X6tzIWdC8V7VzrymvNpfx6/v/FV/FBwR2nDZhcLVcsndrrkMH OXruMDtaetxj7Fjzrs0u/dW9lia84ZqewxVe7NAlnj3QEKRGALu4UCkBwlZleDT32VQJ 2/owfYGc8K2k4DrMIk+DHDF7elKawk5lfk8EnuHtDDJOf9ijHrOLIo/54hY1CREKOgwi LGMNyqMnYb1kwPfQoL2FGhTYYt14q4HWL5J4y+Ynovt20Y5gBiPG0SdwBW5a0P6nfVNS NlPw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=UxWg45im; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EfaTMfYE; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=cTuxMtB8; 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-7cadb338fbbsi7982173a34.144.2025.12.15.07.05.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2025 07:05:17 -0800 (PST) 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=UxWg45im; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EfaTMfYE; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=cTuxMtB8; 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=XVCv/62qVqsvldsDCaJFSBQ37+XeQPYSHcbDIy/gb7U=; b=UxWg45imBjRXmYECuOCOrzPNEk ke5jL+vAlFHZ8rv9b7rDLwzWEql2rhf4lhTzOFYXeafRg9geHDU9k6ccmMmuLMTtI5rJQ2UWUemuE luyUrafPB490EfWpJYQtgwGuG8Q9AWvTeCWg+qb9UpS+EaqeiKdfuiq0a64w7bWSMJLc=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vVA8Q-0000KI-GD; Mon, 15 Dec 2025 15:05:14 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vVA8P-0000KB-Bd for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 15:05:13 +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=oaUhr26CXgU7krGMhFxYQLwz70CWsMFAnTryrHL9QD4=; b=EfaTMfYEwdDNT8KgqzlRExSyeR 2kfD75m5c70iQtN0h3cuVhtm38Wsh8B9ZvoKv/RpP3WY3mjFhzbTZK99k5d8FiYSbLQj7QAY26sOs ezX31NTopO1xdfksWFclT7a0ZxpmckRfmYZXL//5io0e4t/ZOQrV1kmb57S9m4bD1brU=; 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=oaUhr26CXgU7krGMhFxYQLwz70CWsMFAnTryrHL9QD4=; b=cTuxMtB8zREn0UDJDA5zm4ukfo rVTC757k0KgQnL+kWHrZrO881p3msIwD6ZLO2jCHpchOT6PgWDB6xQPijy099sq/20GlPyx8n1wo7 UuOCpeS8lBeXU5gw3HjgBmsnso2I9mL9tXVa7MdFtDENSR1+ws6FyjYDbQt24Nrio7Q8=; Received: from [193.149.48.134] (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 1vVA8O-0002Oa-Cd for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 15:05:13 +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 5BFF50uA018917 for ; Mon, 15 Dec 2025 16:05:00 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5BFF50Go018916 for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 16:05:00 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 15 Dec 2025 16:04:54 +0100 Message-ID: <20251215150500.18898-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: References: 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: Frank Lichtenheld Sigma was computed based on the absolute time and not the delta. Note that this probably makes no actual difference in practice. The sigma value is irrelevant on first call and multi_push_restart_schedule_exit should not be called multiple times since it is only ca [...] 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: 1vVA8O-0002Oa-Cd Subject: [Openvpn-devel] [PATCH v9] multi: Fix wrong sigma value in multi_push_restart_schedule_exit X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1851587158233874304?= X-GMAIL-MSGID: =?utf-8?q?1851587158233874304?= From: Frank Lichtenheld Sigma was computed based on the absolute time and not the delta. Note that this probably makes no actual difference in practice. The sigma value is irrelevant on first call and multi_push_restart_schedule_exit should not be called multiple times since it is only called if deferred_shutdown_signal.signal_received is not set, yet. Change-Id: I62b8263f18c4e2e7f5ecacb4616737f5ba836303 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1311 --- 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/+/1311 This mail reflects revision 9 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index d2d9ba8e..d9cb3a9 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3820,7 +3820,6 @@ { struct hash_iterator hi; struct hash_element *he; - struct timeval tv; /* tell all clients to restart */ hash_iterator_init(m->iter, &hi); @@ -3838,15 +3837,14 @@ /* reschedule signal */ ASSERT(!openvpn_gettimeofday(&m->deferred_shutdown_signal.wakeup, NULL)); - tv.tv_sec = 2; - tv.tv_usec = 0; + struct timeval tv = { .tv_sec = 2, .tv_usec = 0 }; tv_add(&m->deferred_shutdown_signal.wakeup, &tv); m->deferred_shutdown_signal.signal_received = m->top.sig->signal_received; schedule_add_entry(m->schedule, (struct schedule_entry *)&m->deferred_shutdown_signal, &m->deferred_shutdown_signal.wakeup, - compute_wakeup_sigma(&m->deferred_shutdown_signal.wakeup)); + compute_wakeup_sigma(&tv)); signal_reset(m->top.sig, 0); }