From: Frank Lichtenheld Date: Tue, 11 Aug 2026 18:44:02 +0000 (+0200) Subject: otime: Remove openvpn_time() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbd0b53611e96bbc18f9dfade4c0fd3e65b25222;p=thirdparty%2Fopenvpn.git otime: Remove openvpn_time() Using this function seems to be more complicated than just using now directly. Suggested by Arne in review of cppcheck fixes. Change-Id: I2bd5259de702fce5d4ef6926c1dee7c6e6e597d7 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1841 Message-Id: <20260811184408.3535-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg38286.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/otime.h b/src/openvpn/otime.h index f02cc31b4..d14f01ee9 100644 --- a/src/openvpn/otime.h +++ b/src/openvpn/otime.h @@ -93,17 +93,6 @@ update_time(void) #endif } -static inline time_t -openvpn_time(time_t *t) -{ - update_time(); - if (t) - { - *t = now; - } - return now; -} - static inline void tv_clear(struct timeval *tv) { diff --git a/src/openvpn/pkcs11.c b/src/openvpn/pkcs11.c index cfcd3725a..8b06fd07e 100644 --- a/src/openvpn/pkcs11.c +++ b/src/openvpn/pkcs11.c @@ -42,7 +42,8 @@ static time_t __mytime(void) { - return openvpn_time(NULL); + update_time(); + return now; } #if !defined(_WIN32) diff --git a/src/openvpn/push.c b/src/openvpn/push.c index ce2baf238..97f352eb5 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -999,9 +999,7 @@ process_incoming_push_request(struct context *c) else if (tls_authentication_status(c->c2.tls_multi) == TLS_AUTHENTICATION_SUCCEEDED && c->c2.tls_multi->multi_state >= CAS_CONNECT_DONE) { - time_t now; - - openvpn_time(&now); + update_time(); if (c->c2.sent_push_reply_expiry > now) { ret = PUSH_MSG_ALREADY_REPLIED;