duplicate acctuniqueid problem
d tbsky
tbskyd at gmail.com
Wed Jun 10 16:34:58 CEST 2015
Hi:
2015-06-10 21:51 GMT+08:00 Alan DeKok <aland at deployingradius.com>:
> On Jun 10, 2015, at 1:21 AM, d tbsky <tbskyd at gmail.com> wrote:
>> after checking the detail of "queries.conf". I found it is actually
>> a bad thing. when updating it really only use "acctsessionid +
>> username + nasipaddress" to locate existing record without other
>> constraint. so in my case, even I create a unique 'acctuniqid', all
>> the existing records with the same "acctsessionid" will be updated at
>> once. maybe the whole update process in queries.conf should be
>> modified to use "acctuniqid" when locate existing record?
>
> Hmm... in v3.0.x in git, the queries do use Acct-Unique-Session-Id.
>
> Which version are you using? Which queries don't use Acct-Unique-Session-Id?
>
> Alan DeKok.
I am using fr 3.0.8 and my queries.conf comes from 3.0.x git.
i am using mysql, the queries.conf is at
/etc/raddb/mods-config/sql/main/mysql/queries.conf
all the update queries don't use Acct-Unique-Session-Id. it only
use acctsessionid like below:
interim-update {
#
# Update an existing session and calculate the interval
# between the last data we received for the
session and this
# update. This can be used to find stale sessions.
#
query = "\
UPDATE ${....acct_table1} \
SET \
acctupdatetime =
(@acctupdatetime_old:=acctupdatetime), \
acctupdatetime = FROM_UNIXTIME(\
%{integer:Event-Timestamp}), \
acctinterval =
%{integer:Event-Timestamp} - \
UNIX_TIMESTAMP(@acctupdatetime_old), \
framedipaddress =
'%{Framed-IP-Address}', \
acctsessiontime =
'%{Acct-Session-Time}', \
acctinputoctets =
'%{%{Acct-Input-Gigawords}:-0}' \
<< 32 |
'%{%{Acct-Input-Octets}:-0}', \
acctoutputoctets =
'%{%{Acct-Output-Gigawords}:-0}' \
<< 32 |
'%{%{Acct-Output-Octets}:-0}' \
WHERE acctsessionid = '%{Acct-Session-Id}' \
AND username = '%{SQL-User-Name}' \
AND nasipaddress = '%{NAS-IP-Address}'"
More information about the Freeradius-Users
mailing list