From patchwork Wed Oct 10 21:51:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC] Locally abort associations on ASSOC_REJECT events Date: Wed, 10 Oct 2012 11:51:03 -0000 From: Christopher Wiley X-Patchwork-Id: 190760 Message-Id: <1349905864-25674-1-git-send-email-wiley@chromium.org> To: hostap@shmoo.com Respond to AP triggered association failures by locally aborting the association process. For instance, certain enterprise AP's return status code 17 (too many STAs) and reject association requests when a particular AP has too many associated devices. Locally aborting the association process lets wpa_supplicant begin roaming immediately rather than waiting for the authentication timeout to fire. This change duplicates similar behavior that occurs when the driver supports SME. --- wpa_supplicant/events.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 53b8338..854816b 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2524,6 +2524,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, data->assoc_reject.status_code); if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) sme_event_assoc_reject(wpa_s, data); + else + /* We could wait for the auth timer to fire, but it is + * much faster to abort locally sooner rather than + * later. + */ + wpa_supplicant_event_disassoc_finish(wpa_s, + data->assoc_reject.status_code, 1); break; case EVENT_AUTH_TIMED_OUT: if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)