MySQL Accounting in Freeradius

2005-05-05 Thread Andrey
Hi,

I have a question about the uniqueness of the AcctUniqueId field. Everytime
the user connects, the id is always the same. AcctSessionId is always the
same as well. All that would be fine, except that the times get messed up by
being updated to the last AcctStopTime. The update query is as follows:

UPDATE radacct SET AcctStopTime = '2005-05-05 16:08:00', AcctSessionTime = '',
AcctInputOctets = '', AcctOutputOctets = '', AcctTerminateCause = '',
AcctStopDelay = '', ConnectInfo_stop = '' WHERE AcctSessionId =
'00-0f-3d-52-2b-13' AND UserName = 'dialup_username' AND NASIPAddress =
'x.x.x.x'

which consequently updates all the records from before that have the same
AcctSessionId (i.e. all the previous logins by that user).

Is this the way it was intended to work?
For some reason I doubt it, but thought I'd ask just to make sure. If that's a
bug, how would I go about fixing it?

Thanks for your time!

-Andrey





- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: MySQL Accounting in Freeradius

2005-05-05 Thread Alan DeKok
Andrey [EMAIL PROTECTED] wrote:
 I have a question about the uniqueness of the AcctUniqueId field. Everytime
 the user connects, the id is always the same. AcctSessionId is always the
 same as well.

  Then there isn't much you can do.

  Some NAS vendors re-use Acct-Session-Id's, even though the RFC's say
the Id's should be unique.  In order to work around this, we wrote the
acct_unique module, which takes *additional* data, and tries to create
a more unique Id.

  If the AcctUniqueId field is always the same, then the accounting
request contain all the same information, or are missing some
information.  See the acct_unique configuration for a list of
attributes it's using.

 For some reason I doubt it, but thought I'd ask just to make
 sure. If that's a bug, how would I go about fixing it?

  Get your NAS to send real accounting data.  Barring that, there's
nothing you can do.

  As a related question: Pretend you're the RADIUS server, looking at
two or more accounting requests.  How can you tell different sessions
apart of the Acct-Session-Id is the same, and all other information is
the same?  If you can't tell the difference, neither can FreeRADIUS.

  Alan DeKok.

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html