From: Alan T. DeKok Date: Fri, 15 Sep 2023 11:36:02 +0000 (-0400) Subject: catch bad times. X-Git-Tag: release_3_2_4~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2276a683e9d8007673ca785cd73e72fd911bfba1;p=thirdparty%2Ffreeradius-server.git catch bad times. if packet timestamp > now, don't update Acct-Delay-Time --- diff --git a/src/main/detail.c b/src/main/detail.c index a5e8437e1c5..3b7e3820425 100644 --- a/src/main/detail.c +++ b/src/main/detail.c @@ -910,8 +910,16 @@ open_file: rad_assert(vp != NULL); fr_pair_add(&packet->vps, vp); } + + /* + * Update Acct-Delay-Time, but make sure that it doesn't go backwards. + */ if (data->timestamp != 0) { - vp->vp_integer += time(NULL) - data->timestamp; + time_t now = time(NULL); + + if (((time_t) data->timestamp) < now) { + vp->vp_integer += time(NULL) - data->timestamp; + } } }