From patchwork Tue Aug 11 18:44:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5225 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:79d3:b0:87d:ab56:3700 with SMTP id p19csp1028772maz; Tue, 11 Aug 2026 11:44:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RoVjVzwbHl+z2ZGp0YF5HG3jgrL+JpNssxEElLRpl7Ba/2vgd0lOkaOp0UUNXOieTSMpoSW6IElaQg=@openvpn.net X-Received: by 2002:a05:6808:15a4:b0:4a3:f4b7:cbdf with SMTP id 5614622812f47-4b209d18344mr1451073b6e.15.1786473866613; Tue, 11 Aug 2026 11:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786473866; cv=none; d=google.com; s=arc-20260327; b=eG2JSR1bmEXKy0Dpyl0ZNwQhJrpqygfu/4Fho3CJOZJKC9PjrXkuK6CB836AEX6YI1 vf3DxJ0AlbeW5jQTIeoHZhazpvJvJeVjmYW2QRGu2WsoQiORR0fQNBfto+irzSTLIq2V V9unctDARYl4x/powUNHZA+Nk2hCGOBHoKHOUuYpJN14JHFzDCIOgVAN5oCbgy/VSQ9k aBiJNah7voF/vkEXD6Ir1Ryog1UKhRvKIKLTEypqdghAFFaHMwUJkD+3z1qZVefbPRJF QJ9vXjFdR8VcNrah0MOmwfg/VhFEjk0ggPHeLP7DrlA6edUWT3hYab1k8TbzSxRZR3JA Si+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=KfMQwtepzYuiLG/TH44lXSz9148Ji5nXuN5mGJJd93Y=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=UTMTLg6MPCJBkmfr+7DzmT8t8dXgCj8+lSKFyb57Zf5W4wEZNcb74DTD9dBl7moVaO l6lacDZnfFLPX0pm+gUT9BJtcQzFd9JVQ+NUi8Cl94kYVKXEXHsW5Q/YtI9VyCYHknIv Ps5wyqpOmtuH6yfy96QPa0mHMKGNlmCJp1l8GXrIRnPd3s36RHxXbHU6kmDJAIoCG+lT m9dqcbxv/8jyOD+24Ej3zxibbuCBMGF0z0Dat+IPB0VlYcpIBOcA/FvY7s4UCnA82r8g 1mxe4OjnFsOwvyJIKiXtwXjs3ApJNjNzyYGC1BGcufoLuX6GDJVEfdZde7V4utC1L/pv vKTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=LBhxTcTu; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=If5TjCQm; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GNu2funC; 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 5614622812f47-4b1ffef30dcsi1367553b6e.23.2026.08.11.11.44.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2026 11:44:26 -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=LBhxTcTu; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=If5TjCQm; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GNu2funC; 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=KfMQwtepzYuiLG/TH44lXSz9148Ji5nXuN5mGJJd93Y=; b=LBhxTcTutwODDVbWL7Jop9iiDl rde7IVnFRR5BbIMsjLx2M3CZ7yLEeS0giBxdIo2J1ZRDCXy+iJIp9c4zjpALi97lOU5SimEDafCct EQVH91F1gPTEO9QCXGfrPpSTBXRpgW+B0ggRxhhngbUxPyEoZH07FIdwB0o6RONEqp0g=; 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 1wtrSY-0003C0-Ve; Tue, 11 Aug 2026 18:44:20 +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 1wtrSX-0003Bt-Gh for openvpn-devel@lists.sourceforge.net; Tue, 11 Aug 2026 18:44:19 +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=6vCBEQ54luY/JIThanv1LZsHctAkD2GctX1ISBWv3Os=; b=If5TjCQm+WbOQAZOUQyYbCOmBf noawz/Qq80Yj42rqk4upuTw39vGcbntuHWdDA6IRoG42n+L3TJeSg8zrSyrgVUdTN1wCdDq30CF5q hED42Ut0l45qBzARGlCPjM7GyCNeDHH4qkzQhPW0DLoPJzEsouPl66Irq0qZvo2oqhxw=; 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=6vCBEQ54luY/JIThanv1LZsHctAkD2GctX1ISBWv3Os=; b=GNu2funCWjE6SJzMkK2unQ2juO 91o3XSwq+7AkZXNmtCyUUHt/3XLqioNprRdVc6pJiFpkdCJW03X1A7FxKEKATUFKwi6y1ksE+x+lK OVfSJ5rogJdUTb5Ntemcj2CKADpRsMc+/rEhB+xnd7UEVyuFsVJaO1Nb9IyquiBeQnAY=; Received: from [193.149.48.129] (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 1wtrSS-0004GT-8n for openvpn-devel@lists.sourceforge.net; Tue, 11 Aug 2026 18:44:18 +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 67BIi82A003559 for ; Tue, 11 Aug 2026 20:44:08 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 67BIi8r3003558 for openvpn-devel@lists.sourceforge.net; Tue, 11 Aug 2026 20:44:08 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 11 Aug 2026 20:44:02 +0200 Message-ID: <20260811184408.3535-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.0 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-2.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 Using this function seems to be more complicated than just using now directly. Suggested by Arne in review of cppcheck fixes. 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: 1wtrSS-0004GT-8n Subject: [Openvpn-devel] [PATCH v1] otime: Remove openvpn_time() 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: 1873253621108150112 X-GMAIL-MSGID: 1873253621108150112 From: Frank Lichtenheld Using this function seems to be more complicated than just using now directly. Suggested by Arne in review of cppcheck fixes. Change-Id: I2bd5259de702fce5d4ef6926c1dee7c6e6e597d7 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1841 --- 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/+/1841 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/src/openvpn/otime.h b/src/openvpn/otime.h index f02cc31..d14f01e 100644 --- a/src/openvpn/otime.h +++ b/src/openvpn/otime.h @@ -93,17 +93,6 @@ #endif } -static inline time_t -openvpn_time(time_t *t) -{ - update_time(); - if (t) - { - *t = now; - } - return now; -} - static inline void tv_clear(struct timeval *tv) { diff --git a/src/openvpn/pkcs11.c b/src/openvpn/pkcs11.c index cfcd372..8b06fd0 100644 --- a/src/openvpn/pkcs11.c +++ b/src/openvpn/pkcs11.c @@ -42,7 +42,8 @@ static time_t __mytime(void) { - return openvpn_time(NULL); + update_time(); + return now; } #if !defined(_WIN32) diff --git a/src/openvpn/push.c b/src/openvpn/push.c index ce2baf2..97f352e 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -999,9 +999,7 @@ else if (tls_authentication_status(c->c2.tls_multi) == TLS_AUTHENTICATION_SUCCEEDED && c->c2.tls_multi->multi_state >= CAS_CONNECT_DONE) { - time_t now; - - openvpn_time(&now); + update_time(); if (c->c2.sent_push_reply_expiry > now) { ret = PUSH_MSG_ALREADY_REPLIED;