[PATCH v2] nl80211: Add MLME auth work-around for -EEXIST errno

greearb at candelatech.com greearb at candelatech.com
Fri Mar 16 14:31:55 PDT 2018

From: Ben Greear <greearb at candelatech.com>

The 4.9 kernel, at least, can return EEXIST when trying to auth
a station that already exists.

Signed-off-by: Ben Greear <greearb at candelatech.com>

NOTE:  I cannot manage to compile top-of-tree hostapd, due to

[greearb at ben-dt3 hostapd]$ make
../src/drivers/driver_nl80211.c:17:31: fatal error: netlink/genl/genl.h: No such file or directory
compilation terminated.
Makefile:1247: recipe for target '../src/drivers/driver_nl80211.o' failed
make: *** [../src/drivers/driver_nl80211.o] Error 1

So, this patch is not even properly compile tested unfortunately.

We have seen this bug in multiple places, but it is difficult to reproduce.
Here is a link to someone else that appears to have hit this issue.


 src/drivers/driver_nl80211.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 329be02..fd53e4f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3345,10 +3345,10 @@ retry:
 	msg = NULL;
 	if (ret) {
 		wpa_dbg(drv->ctx, MSG_DEBUG,
-			"nl80211: MLME command failed (auth): ret=%d (%s)",
-			ret, strerror(-ret));
+			"nl80211: MLME command failed (auth): count=%d ret=%d (%s)",
+			count, ret, strerror(-ret));
-		if (ret == -EALREADY && count == 1 && params->bssid &&
+		if (((ret == -EALREADY) || (ret == -EEXIST)) && count == 1 && params->bssid &&
 		    !params->local_state_change) {
 			 * mac80211 does not currently accept new

More information about the Hostap mailing list