Stale sessions and mac auth problem

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

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("%{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}"){
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: <>

More information about the Freeradius-Users mailing list