Freeradius-Users Digest, Vol 140, Issue 39
firing neurons
firingneurons at mail.com
Wed Dec 21 07:31:11 CET 2016
It was because Tmp-Integer-0 was used insted of Tmp-String-0.
Using Tmp-String-0 now and there is no overflow.
Still wondering about how to send gigawords reply attribute from
sqlcounter.
Message: 7
Date: Wed, 21 Dec 2016 01:32:51 +0100
From: "firing neurons" <firingneurons at mail.com>
To: freeradius-users at lists.freeradius.org
Subject: attribute overflow from sql query in unlang
Message-ID:
<trinity-89ec53bc-81a7-4948-9c3c-bd47e9d99221-1482280371811 at 3capp-mailc
om-lxa09>
Content-Type: text/plain; charset="UTF-8"
Hi,
The debug logs are(emphasis added):
(6) Executing select query: SELECT
(SUM(acctoutputoctets+acctinputoctets)) AS total
FROM radacct WHERE radacct.username='test'
AND Year(acctstarttime) = (Year(NOW()))
rlm_sql (sql): Released connection (6)
(6) EXPAND %{sql: SELECT (SUM(acc
toutputoctets+acctinputoctets)) AS total
FROM radacct WHERE radacct.username='%{User-Name}'
AND Year(acctstarttime) = (Year(NOW())) }
(6) --> 241450422693
(6) Tmp-Integer-0 := 932254117
(6) EXPAND %{User-Name}
(6) --> test
(6) SQL-User-Name set to 'test'
rlm_sql (sql): Reserved connection (7)
(6) Executing select query: SELECT groupname FROM radusergroup
WHERE username = 'test' ORDER BY priority
rlm_sql (sql): Released connection (7)
(6) EXPAND %{User-Name}
(6) --> test
(6) SQL-User-Name set to 'test'
rlm_sql (sql): Reserved connection (4)
(6) Executing select query: SELECT value FROM radgroupcheck
WHERE attribute='Yearly-Bytes-Limit' AND grou
pname='4Mbps_YR_225GB'
rlm_sql (sql): Released connection (4)
(6) EXPAND %{sql: SELECT value FROM radgroupcheck
WHERE attribute='Yearly-Bytes-Limit' AND grou
pname='%{sql: SELECT groupname FROM radusergroup
WHERE username = '%{User-Name}' ORDER BY priority}'}
(6) --> 241591910400
(6) Tmp-String-1 := 241591910400
(6) } # update control = noop
Why is their an overflow in the first case? I am using radius3
The same query is used by the relevant sqlcounter module and it works
as expected and doesn't overflow.
I am trying to send CoA disconnect to the NAS after the user exhuasts
their data with sql and unlang logic in accounting section.
I also tried simply using the reply attribute Mikrotik-Total-Limit but
the the NAS also expected Mikrotik-Total-Limit-Gigawords.
The sqlcounter I made simply sent overflown value in
Mikrotik-Total-Limit and hence lmit of more than 4Gb couldn't be
enforced.
Any way I can send the extra reply attribute from the sqlcounter?
------------------------------
Subject: Digest Footer
-
List info/subscribe/unsubscribe? See
[1]http://www.freeradius.org/list/users.html
------------------------------
End of Freeradius-Users Digest, Vol 140, Issue 39
*************************************************
References
1. http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list