Endless assoc/disassoc loop due to wpa_driver_nl80211_authenticate

Ben Greear greearb
Thu Nov 3 21:55:51 PDT 2011


I think I found the problem with the 128+ stations issue.

The wpa_driver_nl80211_authenticate method has some retry code
that hits when the kernel returns -EALREADY:

	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
	msg = NULL;
	if (ret) {
		wpa_dbg(drv->ctx, MSG_DEBUG,
			"nl80211: MLME command failed (auth): ret=%d (%s)",
			ret, strerror(-ret));
		count++;
		if (ret == -EALREADY && count == 1 && params->bssid &&
		    !params->local_state_change) {

			/*
			 * mac80211 does not currently accept new
			 * authentication if we are already authenticated. As a
			 * workaround, force deauthentication and try again.
			 */
			wpa_printf(MSG_DEBUG, "nl80211: Retry authentication "
				   "after forced deauthentication");
			wpa_driver_nl80211_deauthenticate(
				bss, params->bssid,
				WLAN_REASON_PREV_AUTH_NOT_VALID);
			nlmsg_free(msg);
			goto retry;
		}
		goto nla_put_failure;
	}

The problem is, that deauth call will cause a DEAUTH event shortly after,
which will cause the station to deauth itself again.  This causes an endless loop of
auth/deauth when you have lots of VIFS in non-WPA mode.

If I just #ifdef out that retry code, it works much better.

Any idea why this was put in to begin with?

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Hostap mailing list