]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
update Acct-Delay-Time calculations
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Aug 2024 15:34:42 +0000 (11:34 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 13 Aug 2024 15:34:42 +0000 (11:34 -0400)
raddb/sites-available/detail

index 64de17ddede30b92da1a62f0b450ade76e654b24..60f5efc7f7ffdbd560eff0096c73b71e2324c7ee 100644 (file)
@@ -241,12 +241,19 @@ server detail {
 #  The detail file reader runs the normal RADIUS / DHCP / etc. processing sections.
 #
 recv Accounting-Request {
-       if (!&Event-Timestamp) {
-               &Event-Timestamp := &Packet-Original-Timestamp
+       #
+       #  If there's an Acct-Delay-Time, increase its value based on the
+       #  difference between when the packet was written, and the current time.
+       #
+       #  Note that we do NOT rely on any Event-Timestamp in the original packet,
+       #  it could be wrong.
+       #
+       if (&Acct-Delay-Time) {
+               &Acct-Delay-Time += %l - &Packet-Original-Timestamp
        }
 
-       if (&Event-Timestamp < %c) {
-               &request.Acct-Delay-Time += %c - &Event-Timestamp
+       if (!&Event-Timestamp) {
+               &Event-Timestamp := &Packet-Original-Timestamp
        }
 
        #