Freeradius sql acctsessiontime is wrong

  • Hi all
    From time to time I got some wrong accounting in sql radius.radacct acctsessiontime. (stoptime - starttime) does not equal to sessiontime and the value is sooo big 2 bil. My Pfsense is a 32 bit. Here is the SS.

    For regular user without time limit this is okey but to users with time limit its really a problem. have to delete the entries then delete the counter db as well.

    My setup is:
    Pfsense is in VM wtih reeradius 2.
    Sql is in the Host of the VM.

  • NVM its fix as Jimp suggested from this post,57632.msg307926.html#msg307926. I think the Nas is sending wrong time. or its the device (an old nokia cell phone). here is a log when it happen.
    php: rc.prunecaptiveportal: Radius accounting debug: Start: 1386328206 Stop: 1386298766 Session time: -29440
    after fix adding + line in /usr/local/captiveportal/
    **  $session_time = $stop_time - $start_time;

    • $session_time = ($session_time >= 0) ? intval($session_time) : 0;**
      setting it tp zero when unsigned acctsessiontime in sql no have zero. dont know if it is the same in db counters have to test it yet with account having time limit.

Log in to reply