attribute overflow from sql query in unlang

firing neurons firingneurons at mail.com
Wed Dec 21 01:32:51 CET 2016


   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?


More information about the Freeradius-Users mailing list