fix problem : wpa_supplicant loops many times with Authentication with aa:bb:cc:dd:ee:ff timed out
johnlumby at hotmail.com
Mon Jun 17 18:17:03 PDT 2019
I have a wifi setup involving hostapd-2.6 (with the wpa_hostap_security_patches) running on a slow machine as AP (80211B radio), servicing various clients. relevant config is RSN, auth key management is by WPA-PSK, and key exchange ciphers are both CCMP-AES.
All clients have always connected and authd successfully except for one : wpa_supplicant-2.6 and more recently 2.8 on a fast machine. It sometimes succeeds right away, but other times it takes many minutes, during which time I see in the wpa_supplicant debug log large number of loops involving
wlan0: Setting authentication timeout: 10 sec 0 usec
[ ... ]
wlan0: Authentication with aa:bb:cc:dd:ee:ff timed out
[ ... ]
wlan0: Request to deauthenticate [ ... ] reason=3 state=ASSOCIATED
but always it eventually succeeds.
I finally decided to try to fix it and created a new configuration option to control the 10 sec auth timeout, so I can set that.
Since there are various places in the source code where different hard-coded values for the timeout secs are passed to wpa_supplicant_req_auth_timeout(), I implemented it as an increment to be added to all the hard-coded values.
I chose 60 sec so that in particular in the above loop the timeout is 70 sec.
And now it succeeds on first try.
Strangely, I see that in most cases with this change, it does not take more than 10 sec to complete the handshake and auth, so I am not quite sure whether or how this change "fixed" it, but based on results, somehow it did fix it. I suspect that if the 10 sec timeout happens once, it somehow results in some kind of lack of synchronisation in the EA message exchanges such that it becomes very difficult to recover, resulting in the near-endless loops. So maybe this fix simply avoids that unlucky slow first handshake attempt.
I think I have seen mention of this kind of problem several times in posts over the years.
I can provide the patch is anyone is interested.
Cheers, John Lumby
More information about the Hostap