Authentication fails if already authenticated.

Paul Stewart pstew at google.com
Fri Jul 30 21:33:41 EDT 2010


Good point.  I brought this up with the compat-wireless folks a few
weeks ago, and Johannes Berg has a patch in the pipeline to fix things
at that level.  The patch is to net/wireless/mlme.c in
compat-wireless:

https://patchwork.kernel.org/patch/111426/

--
Paul

On Fri, Jul 30, 2010 at 4:49 PM, Blaise Gassend <blaise at willowgarage.com> wrote:
> Doing associate-unassociate cycle tests, I discovered a problem with how
> the SME handles authentication problems in 0.7.2. Here is the scenario:
>
> 1) mac80211 is already authenticated with the AP
> 2) you try to associate to the AP
> 3) wpa_driver_nl80211_authenticate tries to authenticate
> 4) the first authentication request fails with EALREADY wpa_driver_nl80211_authenticate sends a deauthentication request and then tries to authenticate again
> 5) the deauthenticate response arrives and cancels the association attempt
> 6) the authenticate response arrives, but nobody is listening anymore.
>
> The following patch fixes the problem, but is a bit hokey as I do not know if we are guaranteed to get a deauthenticate event. It might be preferable to wait for the deauthenticate to complete before retrying the authenticate attempt. It is a bit more involved so I'm curious for feedback from this list before I try this more involved solution.
>
>
> Index: wpa_supplicant/src/drivers/driver_nl80211.c
> ===================================================================
> --- wpa_supplicant/src/drivers/driver_nl80211.c (revision 31464)
> +++ wpa_supplicant/src/drivers/driver_nl80211.c (working copy)
> @@ -113,6 +113,8 @@
>
>        struct i802_bss first_bss;
>
> +        int deauth_before_reauth;
> +
>  #ifdef HOSTAPD
>        int eapol_sock; /* socket for EAPOL frames */
>
> @@ -719,6 +721,19 @@
>                                    MAC2STR(bssid));
>                         return;
>                 }
> +
> +                if (drv->deauth_before_reauth) {
> +                        /*
> +                         * Authentication returned EAGAIN so we are doing a
> +                         * deauthenticate followed by reauthenticate. We
> +                         * can ignore this event.
> +                         */
> +                        drv->deauth_before_reauth = 0;
> +                        wpa_printf(MSG_DEBUG, "nl80211: Deauth received "
> +                                   "as expected (from " MACSTR ") -- ignoring",
> +                                   MAC2STR(bssid));
> +                        return;
> +                }
>         }
>
>        drv->associated = 0;
> @@ -2472,6 +2487,7 @@
>                         * authentication if we are already authenticated. As a
>                         * workaround, force deauthentication and try again.
>                         */
> +                        drv->deauth_before_reauth = 1;
>                        wpa_printf(MSG_DEBUG, "nl80211: Retry authentication "
>                                   "after forced deauthentication");
>                        wpa_driver_nl80211_deauthenticate(
>
>
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>


More information about the HostAP mailing list