Accounting Stop Time to short when idle-timeout
-
I use captive portal with an external free radius server. The accounting works almost fine except when idle-timeout stops accounting. I have an idle timeout of one hour.
If you look the attachment you can see a part of a closed accounting record. Start time was 00:49:36, Stop time was 05:19:54 and Total time is 3 hours, 30 min. and 13 seconds. The effective loged on time was 4 hours and 30 min. This behaviour occurs only when idle-timeout closes the accounting record.
My inquiry gives following result:
Code fragment in pfsense 2.1 (captiveportal.inc - captiveportal_prune_old)
if ($lastact && (($pruning_time - $lastact) >= $uidletimeout)) {
$timedout = true;
$term_cause = 4; // Idle-Timeout
$stop_time = $lastact;Last activity is used for the login duration.
The freeradius server uses the following query:
accounting_stop_query = "
UPDATE ${acct_table2} SET
acctstoptime = '%S',
acctsessiontime = '%{Acct-Session-Time}', \Stoptime is the current time while the "$stop_time" from pfsense is used for the "Acct-Session-Time". Normally the session time is the difference between stop and start time. In case of idle-timeout it differs of the idle-time.
My question: Is this behaviour consciously willed by design? If yes why. It's confusing the have a start and stop time while the session time is not the same difference.
@developer: Could you change this behaviour in next release?
-
I believe this is feature, not a bug :)