Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Accounting Stop Time to short when idle-timeout

    Scheduled Pinned Locked Moved Captive Portal
    2 Posts 2 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      Enrica_CH
      last edited by

      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? 
      Start_stop_time.JPG
      Start_stop_time.JPG_thumb

      1 Reply Last reply Reply Quote 0
      • N
        nothing
        last edited by

        I believe this is feature, not a bug :)

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.