From: "cron2 (Code Review)" Date: Sun, 16 Nov 2025 18:03:08 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <5a7d8e1e58472a200f2667c14ea7f5bfa4d8ef6f-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9vbKcEe9QL4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: forward: Change context_reschedule_sec sec argument to time_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --9vbKcEe9QL4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1356?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: forward: Change context_reschedule_sec sec argument to time= _t ...................................................................... forward: Change context_reschedule_sec sec argument to time_t 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 Message-Id: <20251111155139.31642-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 319.html Signed-off-by: Gert Doering --- M src/openvpn/forward.c 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/56/1356/2 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 90e52d2..f01fb4c 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 =3D sec; + c->c2.timeval.tv_sec =3D (tv_sec_t)sec; c->c2.timeval.tv_usec =3D 0; } } @@ -829,11 +830,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) { @@ -1304,6 +1300,11 @@ #endif /* if defined(ENABLE_DCO) && (defined(TARGET_LINUX) || defined(TARG= ET_FREEBSD)) */ } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + /* * Output: c->c2.buf */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1356?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id9158f477404aac1d6b08b08e672980e5a58dc35 Gerrit-Change-Number: 1356 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --9vbKcEe9QL4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by plaisthos

forward: Change context_resched=
ule_sec sec argument to time_t

This avoids conversions at the caller= sites. Since we only
replace tv_sec if the new value is smaller the cas= t
to tv_sec_t is also safe.

Change-Id: Id9158f477404aac1d6b08b08e= 672980e5a58dc35
Signed-off-by: Frank Lichtenheld <frank@...2641...>= ;
Acked-by: Arne Schwabe <arne-openvpn@...1227...>
Gerrit URL: = https://gerrit.openvpn.net/c/openvpn/+/1356
Message-Id: <202511111551= 39.31642-1-gert@...1296...>
URL: https://www.mail-archive.com/openvpn= -devel@lists.sourceforge.net/msg34319.html
Signed-off-by: Gert Doering &= lt;gert@...1296...>
---
M src/openvpn/forward.c
1 file changed,= 8 insertions(+), 7 deletions(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/56/1356/2
diff --=
git a/src/openvpn/forward.c b/src/openvpn/forward.c
index 9= 0e52d2..f01fb4c 100644
--- a/src/openvpn/forward.c+++ b/src/openvpn/forward.c
@@ -33,6 +33,7 @@
#include "mss.h"
#include "even= t.h"
#include "occ.h"
+#include "otime.h"
#include "ping.h"

#include "ps.h"=
#include "dhcp.h"
@@ -127,7 +12= 8,7 @@
}

static inline = void
-context_reschedul= e_sec(struct context *c, int sec)
+context_reschedule_sec(struct context *c, time_t sec)<= br> {
if (sec < 0)
{
@@ -135,7 +136,7 @@
}
= if (sec < c->c2.timeval.tv_sec)
{
- c->c2.timeval.tv_sec = =3D sec;

+ c-&= gt;c2.timeval.tv_sec =3D (tv_sec_t)sec;
c->c2.t= imeval.tv_usec =3D 0;
}
}
<= span>@@ -829,11 +830,6 @@
#endif /* ENABLE_MANAGEMENT */
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
<= span style=3D"color: hsl(0, 100%, 40%);">-#pragma GCC diagnostic ignored &q= uot;-Wconversion"

= -#endif
-
static void
check_coarse_timers(struct context *c)

{
@@ -1304,6 +1300,11 @@
#en= dif /* if defined(ENABLE_DCO) && (defined(TARGET_LINUX) || defined(= TARGET_FREEBSD)) */
}

+#if defined(__GNUC__) || defined(__cla= ng__)
+#pragma GCC di= agnostic push
+#pragm= a GCC diagnostic ignored "-Wconversion"
+#endif
+
/*
* Output: c->c2.= buf
*/

To view, visit= change = 1356. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id9158f477404aac1d6b08b08e67= 2980e5a58dc35
Gerrit-Change-Number: 1356
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --9vbKcEe9QL4=--