FreeRADIUS 2.1.12 rlm_sqlcounter bug?

ben beneke benekeben at gmail.com
Fri Dec 16 18:44:30 CET 2011


On Fri, Dec 16, 2011 at 3:04 PM, Alan DeKok <aland at deployingradius.com> wrote:
> ben beneke wrote:
>> I am using FreeRADIUS Version 2.1.12, for host i686-pc-linux-gnu,
>> built on Dec 6 2011 at 19:51:34, and I'd like to set up a quota using
>> rlm_sqlcounter.
>> However, the quota I'd like to use is over 4GB and the module will
>> than overflow, not allowing a user who still has quota left.
>
>  Use rlm_expr to do 64-bit math.
>
>  Counters in RADIUS are 32-bits.  So counting more than 4G is
> impossible using "native" attributes.  You need to use rlm_expr to
> calculate the values yourself.
>
>  Alan DeKok.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

rlm_expr doesn't seem to have extensive documentation, nor was I able
to find an example similar to what I want to achieve.
However, if I understand everything correctly, my solution would be
something like the following:

rlm_expr is needed to calculate the difference between the substraction of
"SELECT SUM(AcctOutputOctets+AcctInputOctets) FROM radacct where
UserName='%{${key}}'" (which equals to 25687864955)
and the Max-Octets value in radcheck (equaling 29687864955)

IF $valueradacct < $valueradcheck: Acess Accept ELSE Access Reject

Does this reasoning make any sense?




More information about the Freeradius-Users mailing list