Stale sessions and mac auth problem

Peter webtrontech at gmail.com
Fri Dec 13 01:27:15 CET 2013


Hi
I'm using Coova and Freeradius and I have the entry below to clear stale
sessions when a user logs in. I'm using freeradius version 2.1.10 and I got
the code below from a previous email in this list.

if(User-Name){
        if("%{sql:UPDATE radacct set
AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and
CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}"){
        reject
        }
}
The code above works perfectly for normal users signing in by clearing the
stale session on the first attempt and the user tries again and can log in.
My problem is when it's a mac auth request Coova sends the request at least
twice. This causes the device to log in on the first request and then out
on the second request. So how could I change the empty if statement
"if(User-Name)" to only run this if the the username is not a mac address
"if(User-Name != macaddress)"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20131213/84e4dfbf/attachment.html>


More information about the Freeradius-Users mailing list