linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Vivek Natarajan <vivek.natraj@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	linville@tuxdriver.com
Subject: Re: [PATCH] mac80211: Look out for some other AP when disassoc is received.
Date: Thu, 20 Nov 2008 14:04:49 +0100	[thread overview]
Message-ID: <1227186290.14852.8.camel@johannes.berg> (raw)
In-Reply-To: <8e92b4100811190433l24ab5043nd4e14ff7c7124e20@mail.gmail.com> (sfid-20081119_133338_552806_6F54661F)

[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]

On Wed, 2008-11-19 at 18:03 +0530, Vivek Natarajan wrote:

> Here is the test scenario that exposed this issue:
> * There are two APs with the same SSID so that the sta can roam if one is down.
> * When the AP to which the station is connected is brought down or restarted,
>   it sends( should send according to 802.11 spec) a disassoc frame with a
>   reason code of 8 which means the sender is leaving the BSS.
> * After receiving a disassoc, mac80211 moves to ASSOCIATE state in which scanning
>    is disabled. So, for the first scan request from wpa_supplicant(scan duration of 30sec),
>    it tries to send probe   request to the same AP instead of scanning for other APs.
>    Then it moves to DISABLED  state since there will be no probe response.
> * The next scan request comes only after 30sec and now it will scan for all available APs
>    since scanning  is supported in DISABLED state.
>     So, it takes atleast 30sec to connect to some other AP.

Ok, I understand the scenario, I think. But I don't understand why going
to DISABLED fixes this. In DISABLED the mlme does nothing at all, I
think, so how can that fix it?

We can only request a new scan if we get into ieee80211_sta_config_auth,
which we can only get into by setting IEEE80211_STA_REQ_AUTH, which in
turn we get from ieee80211_sta_req_auth. Therefore, going into disabled
won't help at all.

Ok, I think I see, let me take a step back: you're not just using the
mlme code in the kernel but wpa supplicant as well? That has a 30 second
scan timeout? Seems a bit of a race condition thing, we block scans for
a short time while trying to probe/associate and wpa supplicant requests
one exactly then.

However, I still think going to disabled is wrong. We should be in a
different state and if we detect a problem with the AP, got disconnected
and it didn't respond to probes, then we could go back to scanning if we
had previously been associated. Not if we haven't ever been associated
though because then we could get caught in an endless loop.

I think you've also not accounted for the possibility that the AP simply
lost power for some reason and didn't send a deauth frame at all.

Unfortunately, I don't see a good way to fix this. I've long meant to
completely rewrite the MLME state machine which would have made this
easier, never got around to it though. Taking into account what I've
just said, do you have another idea?

> > Also, the reason code that's being passed is the one we send ourselves,
> > not the one we received.
> 
> I have passed the reason code from ieee80211_rx_mgmt_disassoc which is called
> only after we receive a disassoc frame from the AP.

Yes, but the parameter we pass to that function used to be for the
reason code we send, I have no trouble making it both depending on the
other parameters though, but I guess we should document that if we
really need to do it.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2008-11-20 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  0:03 [PATCH] mac80211: Look out for some other AP when disassoc is received Vivek Natarajan
2008-11-19 11:55 ` Johannes Berg
2008-11-19 12:33   ` Vivek Natarajan
2008-11-20 13:04     ` Johannes Berg [this message]
2008-11-21 11:46       ` Vivek Natarajan
2008-11-21 11:52         ` Johannes Berg
2008-11-22  4:01           ` Vivek Natarajan
  -- strict thread matches above, loose matches on Subject: below --
2008-11-22  4:13 Vivek Natarajan
2008-11-21 14:44 ` Johannes Berg
2008-11-22  6:19 Vivek Natarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1227186290.14852.8.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=vivek.natraj@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).