"[sql] stop packet with zero session length" problem

Selahattin Cilek selahattin_cilek at hotmail.com
Tue Apr 4 14:39:41 CEST 2017

On 04.04.2017 15:33, Alan DeKok wrote:

On Apr 4, 2017, at 1:25 AM, Selahattin Cilek <selahattin_cilek at hotmail.com><mailto: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 '']

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

Thanks for the advice, I'll give it a try. The solution was obvious, was it not?

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.

Well, it is not a matter of choice. The reason is just embarrassing, I can't tell you why. Please do not ask.

  Alan DeKok.

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

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>      Virus-free. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

More information about the Freeradius-Users mailing list