From: "flichtenheld (Code Review)"
Date: Fri, 24 Oct 2025 16:52:50 +0000
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net
Message-ID:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="qo/L/eUFLiw="; 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: plaisthos
Cc: openvpn-devel
--qo/L/eUFLiw=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1299?usp=3Demail
to review the following change.
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
---
M src/openvpn/ssl.c
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/99/1299/1
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 54b69ea..925c5af 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -1108,11 +1108,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)
{
@@ -1120,11 +1120,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.
@@ -1786,6 +1781,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: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6bc3147d10ca50291110335cd9fc3be961280c1b
Gerrit-Change-Number: 1299
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
--qo/L/eUFLiw=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is cur=
rently required from: plaisthos.
flichtenheld would like plaisthos to review this change.
V=
iew Change
ssl: Change update argument of compute_earl=
iest_wakeup to time_t
Since we usually input a diff of two time_t va=
lues here
the input value will be officially time_t. So avoid
convers=
ion warnings at almost every caller site.
We can safely cast it to i=
nterval_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: I6bc3147d10ca50291110335cd9fc3b=
e961280c1b
Signed-off-by: Frank Lichtenheld <frank@...2641...>
=
---
M src/openvpn/ssl.c
1 file changed, 7 insertions(+), 7 deletions(=
-)
git pull ssh://gerrit.openvpn.net:29418/openv=
pn refs/changes/99/1299/1
diff --git a/src/openvpn/ssl.c b/src/open=
vpn/ssl.c
index 54b69ea..925c5af 100644
---=
a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -1108,11 +1108,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)
{
@@ -1120,11 +1120,6 @@
}
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored &quo=
t;-Wconversion"
-#=
endif
-
/*
* Return true if "lame duck" or retiring k=
ey has expired and can
* no longer be used.
@@ -1786,6 +1781,11 @@
return true;
}
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wco=
nversion"
+#endi=
f
+
=
static bool
write_string(struct buffer *buf, const char *s=
tr, const int maxlen)
{
<=
p>To view, visit change 1299. To unsubscribe, or for help writing mail filters=
, visit settings=
.
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6bc3147d10ca50291110335cd9f=
c3be961280c1b
Gerrit-Change-Number: 1299
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...=
.>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...=
..1227...>
=
--qo/L/eUFLiw=--