"[sql] stop packet with zero session length" problem
Alan DeKok
aland at deployingradius.com
Tue Apr 4 14:33:47 CEST 2017
On Apr 4, 2017, at 1:25 AM, Selahattin Cilek <selahattin_cilek at hotmail.com> wrote:
> Since I cannot tell the site owners to dump all their Ubiquiti hardware and buy new equipment, my only option is to make the most of FreeRADIUS configuration and MySQL programming to compensate for the firmware bugs in the UAP. However, there is one bug for which I have not been able to find a workaround.
>
> Sometimes, and for some reason that is unknown to me, when a user connects to a UAP NAS, he is immediately kicked out. We can see that in the accounting details log of the NAS:
> ...
> I believe this is ridiculous. How on earth could someone be connected to a WLAN for 0 seconds, right? We can observe this bug in FreeRADIUS log messages too:
>
> Apr 4 08:02:36 radiusd 96187 [sql] stop packet with zero session length. [user '99481225842', nas '192.168.0.31']
>
> So what is the problem? Well, the problem is that when FreeRADIUS receives the first packet, it runs a custom MySQL stored procedure I have written myself, which enters a record into the radacct table. But because it refuses to accept the second packet, I end up with a suspended session. And because users allowed to connect one device only to the network (Simultaneous-Use := 1), they will have to wait for 10 minutes for the suspended session to drop, thanks to a custom bash script.
>
> My question is:
> How can I make the sql module to accept accounting packets with zero session length?
Follow Adam's suggestion. In code:
accounting {
...
if (Acct-Session-Time == 0) {
update request {
Acct-Session-Time := 1
}
}
sql
...
}
> PS: Upgrading to FreeRADIUS 3.x is not an option.
I've never understood that approach. Yes, you *can* upgrade. You simply choose not to.
Alan DeKok.
More information about the Freeradius-Users
mailing list