[RFC] wpa_supplicant: add fast reconnect support

Jouni Malinen j
Sun Dec 4 12:17:50 PST 2011


On Tue, Sep 27, 2011 at 04:35:02PM +0200, Johannes Berg wrote:
> On Wed, 2011-09-21 at 11:36 -0700, Sam Leffler wrote:
> > I totally agree.  Since that patch I had to fix some edge cases and
> > there may still be more.  I think to make this work right it needs to
> > be carefully tied to the SME pieces of supplicant or madness will
> > ensue.  OTOH all this could be dramatically simplified if one could
> > just re-auth w/o having to re-establish the BSS entry in the kernel by
> > doing the 1-channel scan...

> I don't think it's actually possible though since we rely on the BSS
> entry for a whole bunch of things like knowing what we're connected to.

This is probably fine as long as you can use wpa_supplicant for the
connection.. If you try to implement your own nl80211 commands and SME
handler, you'll likely soon wish you had used something that had already
implemented this.. ;-)

> Maybe it'd be possible to hide it in driver_nl80211?

Yes, that sounds like a good approach here and it certainly makes core
wpa_supplicant implementation much simpler. This turned out to be quite
a bit of code, but it's there now:

commit 536fd62dba5480a2490726f0e3a9bc38225b0904
    nl80211: Recover from auth req ENOENT with a scan
 1 file changed, 149 insertions(+)


The core code changes to kick this on recoverable reason codes in
deauth/disassoc:

commit d00821e913eda00e3c61aaacc78687766f150d11
    Try to reconnect to the same BSS on recoverable disconnection
 1 file changed, 34 insertions(+), 3 deletions(-)


This goes through all the wpa_state values in the same way as normal
connection would (well, apart from SCANNING). In the case the cfg80211
BSS entry exists, the reconnection is pretty much instant. In case the
single channel scan has to be done, about 100 msec seems to get added
(with mac80211_hwsim; maybe some more with real hardware).

I've done only limited testing on this so far and would be interested in
hearing whether this addresses all optimizations done in the chromiumos
patches (there was more than just the one posted on this list). At least
the filtering of old scan results is not included here, so it might be
worth consideration of adding it.

Actually, the scan results are not even fetched to user space at this
point, so BSS missing from there would not be noticed anyway.. Though,
it should be easy to fetch the results for this special
within-driver_nl80211.c scan, too, and at least check that the target
BSS is included. Now this happens kind of implicitly if the second
attempt at nl80211 auth command fails.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list