From: Alan T. DeKok Date: Sun, 19 Dec 2010 11:03:47 +0000 (+0100) Subject: Look for, and use Event-Timestamp X-Git-Tag: release_2_1_11~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77da3eb2c9c277ea1a452689fa7d021bbfc82ee3;p=thirdparty%2Ffreeradius-server.git Look for, and use Event-Timestamp To calculate Acct-Delay-Time --- diff --git a/src/main/detail.c b/src/main/detail.c index 5fdb5752748..f94961e64df 100644 --- a/src/main/detail.c +++ b/src/main/detail.c @@ -678,6 +678,17 @@ int detail_recv(rad_listen_t *listener, */ packet->vps = paircopy(data->vps); + /* + * Prefer the Event-Timestamp in the packet, if it + * exists. That is when the event occurred, whereas the + * "Timestamp" field is when we wrote the packet to the + * detail file, which could have been much later. + */ + vp = pairfind(packet->vps, PW_EVENT_TIMESTAMP); + if (vp) { + data->timestamp = vp->vp_integer; + } + /* * Look for Acct-Delay-Time, and update * based on Acct-Delay-Time += (time(NULL) - timestamp)