[PATCH] Use correct BSSID for deauth/disconnect in mac80211 EALREADY workaround

Mykyta Iziumtsev mykyta.iziumtsev
Sun Sep 30 12:50:40 PDT 2012


Hi Johannes,

Maybe I'm missing something obvious.
I'll try to analyse code deeper, and get back with proof links.
Thank you!

/Mykyta

On Fri, Sep 28, 2012 at 12:36 PM, Johannes Berg
<johannes at sipsolutions.net> wrote:
> On Fri, 2012-09-28 at 09:52 +0200, Mykyta Iziumtsev wrote:
>
>> >> @@ -4658,7 +4660,7 @@ retry:
>> >>                       wpa_printf(MSG_DEBUG, "nl80211: Retry authentication "
>> >>                                  "after forced deauthentication");
>> >>                       wpa_driver_nl80211_deauthenticate(
>> >> -                             bss, params->bssid,
>> >> +                             bss, prev_auth_bssid,
>> >>                               WLAN_REASON_PREV_AUTH_NOT_VALID);
>> >>                       nlmsg_free(msg);
>> >>                       goto retry;
>> >
>> > I'm not convinced this is correct. If cfg80211 returns -EALREADY, it
>> > means "already authenticated with this BSS". So it seems using
>> > params->bssid here would be correct in order to re-authenticate.
>> >
>> > The case where we can't authenticate because it's already authenticated
>> > with more APs than it would like to track will return -ENOSPC. Note like
>> > I said, starting from kernel 3.4 all this went away.
>>
>> This code is actually workaround for older versions of mac80211 returning
>> -EALREADY when we're already connected to some BSS. Please refer to
>> commit 6d6f4bb87f33278aed133875d0d561eb55d7ae59 in hostap.git .
>
> Yes, I know.
>
>> So, we should expect -EALREADY not only in "already authenticated with this BSS"
>> case, but in "already authenticated with *any* BSS" case.
>
> No, that's not true.
>
>> Of course, mac80211 doesn't have this problem any more when userspace
>> SME is in use, but it still returns -EALREADY when "connect" API is used
>> (in compat-wireless-3.2.5-1).
>
> Well you're not modifying the CONNECT API use though, you're modifying
> the AUTHENTICATE API in a way that actually breaks the -EALREADY
> workaround.
>
> I could see a bit of value in doing the clear_state_mismatch()
> workaround if you get -EALREADY or -ENOSPC, but what you're doing here
> seems to break it.
>
> johannes
>



More information about the Hostap mailing list