From: Arran Cudbard-Bell Date: Thu, 23 Sep 2021 17:24:41 +0000 (-0500) Subject: Add `fr_time_max()` X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05965bd6ed59326608cfd5aaeadb9da6eadb8db3;p=thirdparty%2Ffreeradius-server.git Add `fr_time_max()` --- diff --git a/src/lib/util/time.h b/src/lib/util/time.h index 06324b1b4b..69e30803e1 100644 --- a/src/lib/util/time.h +++ b/src/lib/util/time.h @@ -49,7 +49,9 @@ extern "C" { * plays with the local clock. */ typedef struct fr_time_s { - int64_t value; + int64_t value; //!< Signed because we need times before the server started + ///< for things like certificate validity checks and cache + ///< entries. } fr_time_t; /** "Unix" time. This is the time in nanoseconds since midnight January 1, 1970 @@ -72,6 +74,7 @@ typedef uint64_t fr_unix_time_t; */ typedef int64_t fr_time_delta_t; +#define fr_time_max() (fr_time_t){ .value = INT64_MAX } #define fr_time_wrap(_time) (fr_time_t){ .value = (_time) } #define fr_time_unwrap(_time) (_time).value diff --git a/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c b/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c index 1f2569f9b9..7c0214f302 100644 --- a/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c +++ b/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c @@ -857,7 +857,7 @@ static fr_radius_packet_code_t eap_fast_process_tlvs(request_t *request, eap_ses if (vp->da == attr_eap_fast_pac_acknowledge) { if (vp->vp_uint32 == EAP_FAST_TLV_RESULT_SUCCESS) { code = FR_RADIUS_CODE_ACCESS_ACCEPT; - t->pac.expires = fr_time_wrap(~fr_time_unwrap(fr_time_wrap(0))); + t->pac.expires = fr_time_max(); t->pac.expired = false; t->stage = EAP_FAST_COMPLETE; }