From: Arran Cudbard-Bell Date: Thu, 21 Mar 2024 20:45:04 +0000 (-0400) Subject: Cache TTL should return a time delta X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace8ad792b736968b751fe98d910a5f3971e4182;p=thirdparty%2Ffreeradius-server.git Cache TTL should return a time delta --- diff --git a/src/modules/rlm_cache/rlm_cache.c b/src/modules/rlm_cache/rlm_cache.c index 630b4af51a1..79bd385fcb6 100644 --- a/src/modules/rlm_cache/rlm_cache.c +++ b/src/modules/rlm_cache/rlm_cache.c @@ -31,6 +31,8 @@ RCSID("$Id$") #include #include #include +#include +#include #include #include @@ -916,8 +918,8 @@ static xlat_action_t cache_ttl_get_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, return XLAT_ACTION_DONE; } - MEM(vb = fr_value_box_alloc_null(ctx)); - vb->vb_int64 = fr_time_delta_unwrap(fr_unix_time_sub(c->expires, fr_time_to_unix_time(request->packet->timestamp))); + MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_TIME_DELTA, NULL)); + vb->vb_time_delta = fr_unix_time_sub(c->expires, fr_time_to_unix_time(request->packet->timestamp)); fr_dcursor_append(out, vb); cache_free(inst, &c);