From: "cron2 (Code Review)" Date: Sun, 16 Nov 2025 22:02:26 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ZRDAHJThgUk="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl: Change update argument of compute_earliest_wakeup to time_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --ZRDAHJThgUk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#6) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1299?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: ssl: Change update argument of compute_earliest_wakeup to t= ime_t ...................................................................... ssl: Change update argument of compute_earliest_wakeup to time_t Since we usually input a diff of two time_t values here the input value will be officially time_t. So avoid conversion warnings at almost every caller site. We can safely cast it to interval_t here because we checked that it is smaller than the interval_t value earliest. And all negative values are treated equal, so exact value doesn't matter. Change-Id: I6bc3147d10ca50291110335cd9fc3be961280c1b Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1299 Message-Id: <20251116183622.11727-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 482.html Signed-off-by: Gert Doering --- M src/openvpn/ssl.c 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/99/1299/6 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 2d24f5e..92a68d0 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -1107,11 +1107,11 @@ * called again. */ static inline void -compute_earliest_wakeup(interval_t *earliest, interval_t seconds_from_now) +compute_earliest_wakeup(interval_t *earliest, time_t seconds_from_now) { if (seconds_from_now < *earliest) { - *earliest =3D seconds_from_now; + *earliest =3D (interval_t)seconds_from_now; } if (*earliest < 0) { @@ -1119,11 +1119,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /* * Return true if "lame duck" or retiring key has expired and can * no longer be used. @@ -1338,7 +1333,7 @@ /* For now we hardcode this to be 16 for the software based data chann= el * DCO based implementations/HW implementation might adjust this number * based on their expected speed */ - const int future_key_count =3D 16; + const uint8_t future_key_count =3D 16; int key_direction =3D server ? KEY_DIRECTION_INVERSE : KEY_DIRECTION_N= ORMAL; struct key_direction_state kds; @@ -1785,6 +1780,11 @@ return true; } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + static bool write_string(struct buffer *buf, const char *str, const int maxlen) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1299?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: I6bc3147d10ca50291110335cd9fc3be961280c1b Gerrit-Change-Number: 1299 Gerrit-PatchSet: 6 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --ZRDAHJThgUk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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

View Change

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

ssl: Change update argument of comp=
ute_earliest_wakeup to time_t

Since we usually input a diff of two t= ime_t values here
the input value will be officially time_t. So avoidconversion warnings at almost every caller site.

We can safely cast= it to interval_t here because we
checked that it is smaller than the in= terval_t value
earliest. And all negative values are treated equal,
s= o exact value doesn't matter.

Change-Id: I6bc3147d10ca5029111033= 5cd9fc3be961280c1b
Signed-off-by: Frank Lichtenheld <frank@...2641...= >
Acked-by: Gert Doering <gert@...1296...>
Gerrit URL: https= ://gerrit.openvpn.net/c/openvpn/+/1299
Message-Id: <20251116183622.11= 727-1-gert@...1296...>
URL: https://www.mail-archive.com/openvpn-deve= l@lists.sourceforge.net/msg34482.html
Signed-off-by: Gert Doering <ge= rt@...1296...>
---
M src/openvpn/ssl.c
1 file changed, 8 insert= ions(+), 8 deletions(-)

git pull ssh://gerrit.op=
envpn.net:29418/openvpn refs/changes/99/1299/6
diff --git a/src/ope=
nvpn/ssl.c b/src/openvpn/ssl.c
index 2d24f5e..92a68d0 10064= 4
--- a/src/openvpn/ssl.c
+++ b/src/openvpn= /ssl.c
@@ -1107,11 +1107,11 @@
* called a= gain.
*/
static inline void
-compute_earliest_wakeup(interval_t= *earliest, interval_t seconds_from_now)
+compute_earliest_wakeup(interval_t *earliest, time_t s= econds_from_now)
{
if (seconds_from_n= ow < *earliest)
{
- *earliest =3D seconds_from_now;
+ *earliest =3D (interval_t)s= econds_from_now;
}
if (*earliest = < 0)
{
@@ -1119,11 +1119,6 @@

}
}

-#if defined(__GNUC__) || defined(__clang__= )
-#pragma GCC diagnost= ic push
-#pragma GCC di= agnostic ignored "-Wconversion"
-#endif
-
/*
* Return true if "lame duc= k" or retiring key has expired and can
* no longer b= e used.
@@ -1338,7 +1333,7 @@
/* For n= ow we hardcode this to be 16 for the software based data channel
= * DCO based implementations/HW implementation might adjust this= number
* based on their expected speed */
= - const int future_key_count = =3D 16;
+ const ui= nt8_t future_key_count =3D 16;

int k= ey_direction =3D server ? KEY_DIRECTION_INVERSE : KEY_DIRECTION_NORMAL;
struct key_direction_state kds;
@@ -1785,= 6 +1780,11 @@
return true;
}
+#if define= d(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion&quo= t;
+#endif
= +
static bool<= /span>
write_string(struct buffer *buf, const char *str, const in= t maxlen)
{

To view, v= isit cha= nge 1299. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6bc3147d10ca50291110335cd9f= c3be961280c1b
Gerrit-Change-Number: 1299
Gerrit-PatchSet: 6
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --ZRDAHJThgUk=--