From patchwork Tue Nov 11 15:51:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4579 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:33c4:b0:7b1:439f:bdf with SMTP id u4csp1973676maf; Tue, 11 Nov 2025 07:51:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXGMxGWlh9MTG+7xUp+iWQEsfE9yawJgEtz0dw+bTG01eqNZQPXdo9uotatznJ/O+valOe5GrJJOa8=@openvpn.net X-Google-Smtp-Source: AGHT+IGx385mI3khJOISI4NKUy039LCsIRKz+4q4kUiBws7iFI/giS2xtcbDCHU6ljz9P3X0yT/p X-Received: by 2002:a05:6870:171b:b0:2e8:f5d6:2247 with SMTP id 586e51a60fabf-3e7c2959964mr8574659fac.32.1762876310370; Tue, 11 Nov 2025 07:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762876310; cv=none; d=google.com; s=arc-20240605; b=jXN3CGbPxB4wqsY9uAp2daM9bMjGYbKhdEbBfLacFkgGo4tYMwVJ8NQnvGrK8LQrkd xPNmxaT8tgLvsvmO9Dlcf/bhtIuQnUrduSbPfIVirsu8MTv6ktQDj1qA0B6YYaW7OAlV lp8tzlCm19bnge6Nc/jRvacBuUQNCUTJeJKV7aqCtK7JFN0z7ed7bYGNMaH78jF/m1ms EXfytDz6AJqNeSrB4r5lI4z5Kp9SZzpoB7uTYrBkQpi9HYVvJUD/yCBjaBcwhpqG3ZdU e/H2olpeb1z90DX7+yqvJa+izYnw213VkH6mF2P2DDhWDLDBPZe/6xNpuJj9wY5NHpm0 /jIQ== 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=ka9QQWcwqEgEr9pJoROxyGxc35cqkBdOjak6CtpzioQ=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=iuIlWJV2mTP31YfGqPR6pBrjd+GmIibf+0aHMIbpREMBgC46vhqweDY87G5V/P5K2S dHtwGWXrhDkQgamjKZrCA2rDzpUCnNJuCqJXNiQh4lM5caZVQVJ1OVB71EjlsVx48E4m TOdj+RJ9EYuWAOkZBOgL+0JkHfbWEHLJqHA/n4bpxfVXuatiy4AR9emik0r2JgNINQ8T LOQPfJG6eAQUKo+FrMEx9Y3K8c0i2ya6WiUykxM3pEjqJPQ4SqaQkV2SNbBfKVzIbE2h unLuu9Kvbi+AD8CY0Y3OojXYJUAkhSUampCWvCz+pbGzJaCcU79UkhKGLixIEoij9VFe rAmg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=I2f6y2mJ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="D/TWCM/F"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=jV3usmYC; 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 586e51a60fabf-3e41f13d057si6837421fac.166.2025.11.11.07.51.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Nov 2025 07:51:50 -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=I2f6y2mJ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="D/TWCM/F"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=jV3usmYC; 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=ka9QQWcwqEgEr9pJoROxyGxc35cqkBdOjak6CtpzioQ=; b=I2f6y2mJA78jEviqy+FQa7/6D/ PAjXVXDqcq4aRXzVJN8sTrFNPswZtl8zysrkyP1FwPpYiXMVPYSedn8K1x4i/+gEtvQd5YJP9hrkL SJ+lwImOMg4F/lSWC3LGpwJrnGWWMbJmP3XgKZUy0/YzYxq9OxcMTADzEi/Si3T0dU7s=; 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 ) id 1vIqep-0006DU-Kx; Tue, 11 Nov 2025 15:51:48 +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 ) id 1vIqeo-0006DN-LT for openvpn-devel@lists.sourceforge.net; Tue, 11 Nov 2025 15:51:47 +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=gNMMcxQbfoaeYHJvwSkeKD3EPQ3wV+3OviS/IVxLU74=; b=D/TWCM/Fe9dEpzORLNbcQQosFG o5j+yFwdPOHiRQVZFxKwbokUy2VJQhJkhvMqtP4cL3YX4Onwrdw7ALoVothzvvsFY7h5CQsw73GG9 azs6UxjJ2fQL+exxYpoNOaBY+kFYbEKQ8sDsHOSBh8GOqBhpcNGbzKtpq9VB2M90Bt40=; 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=gNMMcxQbfoaeYHJvwSkeKD3EPQ3wV+3OviS/IVxLU74=; b=jV3usmYCIjpD5sna883F0TXa/j G2k1jVlYSwXeggJwkeqhjJC+IVqapQ+UY9I2yT7/yD0KyeV/ZemrNmSDM/9nawWGHcTFXh9wScs4U JKrGXGKHMmpGUD846QaKRE4bRcBdAqRIrjQQ+dLW2EcN5hBVBaEaxwwIpUjzXXyqIq/Y=; 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 1vIqeo-0006Gj-Kn for openvpn-devel@lists.sourceforge.net; Tue, 11 Nov 2025 15:51:47 +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 5ABFpesJ031666 for ; Tue, 11 Nov 2025 16:51:40 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5ABFpeI1031665 for openvpn-devel@lists.sourceforge.net; Tue, 11 Nov 2025 16:51:40 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 11 Nov 2025 16:51:31 +0100 Message-ID: <20251111155139.31642-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 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 This avoids conversions at the caller sites. Since we only replace tv_sec if the new value is smaller the cast to tv_sec_t is also safe. Change-Id: Id9158f477404aac1d6b08b08e672980e5a58dc35 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c [...] 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: 1vIqeo-0006Gj-Kn Subject: [Openvpn-devel] [PATCH v1] forward: Change context_reschedule_sec sec argument to time_t 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?1848509789710344445?= X-GMAIL-MSGID: =?utf-8?q?1848509789710344445?= From: Frank Lichtenheld This avoids conversions at the caller sites. Since we only replace tv_sec if the new value is smaller the cast to tv_sec_t is also safe. Change-Id: Id9158f477404aac1d6b08b08e672980e5a58dc35 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1356 --- 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/+/1356 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index cffb310..fbef539 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -33,6 +33,7 @@ #include "mss.h" #include "event.h" #include "occ.h" +#include "otime.h" #include "ping.h" #include "ps.h" #include "dhcp.h" @@ -127,7 +128,7 @@ } static inline void -context_reschedule_sec(struct context *c, int sec) +context_reschedule_sec(struct context *c, time_t sec) { if (sec < 0) { @@ -135,7 +136,7 @@ } if (sec < c->c2.timeval.tv_sec) { - c->c2.timeval.tv_sec = sec; + c->c2.timeval.tv_sec = (tv_sec_t)sec; c->c2.timeval.tv_usec = 0; } } @@ -822,11 +823,6 @@ #endif /* ENABLE_MANAGEMENT */ } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static void check_coarse_timers(struct context *c) { @@ -1297,6 +1293,11 @@ #endif /* if defined(ENABLE_DCO) && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD)) */ } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + /* * Output: c->c2.buf */