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/+/1356?usp=email
to review the following change.
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 <[email protected]>
---
M src/openvpn/forward.c
1 file changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/56/1356/1
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
*/
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1356?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id9158f477404aac1d6b08b08e672980e5a58dc35
Gerrit-Change-Number: 1356
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel