Currently RADIUS accounting creates something like this:
Acct-Input-Packets = 825832760
Acct-Output-Packets = 909522481
In this example the types and values should have been something like this:
Acct-Input-Octets = 1959858
Acct-Output-Octets = 67770
In other words, wifidog lifts byte counters from clients, so the RADIUS attributes should be changed to Octets from Packets. Also, the counter values are not correctly converted from string to integer values.
The fix for RADIUS attribute types is to change RADIUS_ACCT_INPUT/OUTPUT_PACKETS to RADIUS_ACCT_INPUT/OUTPUT_OCTETS in wifidog-auth/wifidog/classes/Authenticators/AuthenticatorRadius.php
My intial fix to correct the string to integer conversion, which I now think is not completely correct, was to replace incoming with intval($info['incoming'] and do the respective change for outgoing too.
This fix gives correct values to RADIUS accounting, but does not
- correct the values that get inserted in the database
- work when the counters exceed 231
Please see e.g., http://fi2.php.net/intval for discussions how intval works only upto 231. The reader suggested fix seems to be converting the values with something like incoming +=0.
I think the fix should go into wifidog-auth/wifidog/auth/index.php but I have not tried this, since I do not have a working wifidog client currently.