<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt">I had a suspicion I was not doing this correctly. Thanks!<br><br><div class="gmail_quote">On Sat, Nov 3, 2012 at 5:00 AM, Jouni Malinen <span dir="ltr"><<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Oct 10, 2012 at 02:51:03PM -0700, Christopher Wiley wrote:<br>
> Respond to AP triggered association failures by locally aborting the<br>
> association process. For instance, certain enterprise AP's return<br>
> status code 17 (too many STAs) and reject association requests when a<br>
> particular AP has too many associated devices. Locally aborting the<br>
> association process lets wpa_supplicant begin roaming immediately rather<br>
> than waiting for the authentication timeout to fire.<br>
<br>
This is actually based on Authentication frame getting rejected instead<br>
of association getting rejected.. I was trying to reproduce this by<br>
making the AP reject the Association Request frame and that was actually<br>
handled already since cfg80211 deauthenticates and indicates a<br>
deauthentication event to user space in such a case. For rejected<br>
Authentication frame, no such event happen and that is the not covered<br>
case even though the internal event in wpa_supplicant is called<br>
EVENT_ASSOC_REJECT.<br>
<br>
> This change duplicates similar behavior that occurs when the driver<br>
> supports SME.<br>
<br>
> diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c<br>
> if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)<br>
> sme_event_assoc_reject(wpa_s, data);<br>
> + else<br>
> + /* We could wait for the auth timer to fire, but it is<br>
> + * much faster to abort locally sooner rather than<br>
> + * later.<br>
> + */<br>
> + wpa_supplicant_event_disassoc_finish(wpa_s,<br>
> + data->assoc_reject.status_code, 1);<br>
<br>
This function is supposed to be used in the case where association has<br>
already happened successfully. It does quite a bit of steps that are not<br>
needed or desired for the case where we did not get associated. I<br>
handled this with a bit different change that uses the common connection<br>
failure routine:<br>
<br>
<br>
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c<br>
index 53b8338..1aa9c21 100644<br>
--- a/wpa_supplicant/events.c<br>
+++ b/wpa_supplicant/events.c<br>
@@ -2524,6 +2524,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,<br>
data->assoc_reject.status_code);<br>
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)<br>
sme_event_assoc_reject(wpa_s, data);<br>
+ else {<br>
+ const u8 *bssid = data->assoc_reject.bssid;<br>
+ if (bssid == NULL || is_zero_ether_addr(bssid))<br>
+ bssid = wpa_s->pending_bssid;<br>
+ wpas_connection_failed(wpa_s, bssid);<br>
+ wpa_supplicant_mark_disassoc(wpa_s);<br>
+ }<br>
break;<br>
case EVENT_AUTH_TIMED_OUT:<br>
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jouni Malinen PGP id EFC895FA<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</font></span></blockquote></div><br></div>