<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">&lt;<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>&gt;</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>
&gt; Respond to AP triggered association failures by locally aborting the<br>
&gt; association process.  For instance, certain enterprise AP&#39;s return<br>
&gt; status code 17 (too many STAs) and reject association requests when a<br>
&gt; particular AP has too many associated devices.  Locally aborting the<br>
&gt; association process lets wpa_supplicant begin roaming immediately rather<br>
&gt; 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>
&gt; This change duplicates similar behavior that occurs when the driver<br>
&gt; supports SME.<br>
<br>
&gt; diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c<br>
&gt;               if (wpa_s-&gt;drv_flags &amp; WPA_DRIVER_FLAGS_SME)<br>
&gt;                       sme_event_assoc_reject(wpa_s, data);<br>
&gt; +             else<br>
&gt; +                     /* We could wait for the auth timer to fire, but it is<br>
&gt; +                      * much faster to abort locally sooner rather than<br>
&gt; +                      * later.<br>
&gt; +                      */<br>
&gt; +                     wpa_supplicant_event_disassoc_finish(wpa_s,<br>
&gt; +                             data-&gt;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-&gt;assoc_reject.status_code);<br>
                if (wpa_s-&gt;drv_flags &amp; WPA_DRIVER_FLAGS_SME)<br>
                        sme_event_assoc_reject(wpa_s, data);<br>
+               else {<br>
+                       const u8 *bssid = data-&gt;assoc_reject.bssid;<br>
+                       if (bssid == NULL || is_zero_ether_addr(bssid))<br>
+                               bssid = wpa_s-&gt;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-&gt;drv_flags &amp; 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>