[PATCH] Fix scan notification in case of canceling scan

Dmitry Shmidt dimitrysh
Mon Apr 11 15:50:39 PDT 2011

On Mon, Apr 11, 2011 at 3:39 PM, Jouni Malinen <j at w1.fi> wrote:
> On Mon, Apr 11, 2011 at 02:58:42PM -0700, Dmitry Shmidt wrote:
>> >From this point of view - no, but here is the problem. You start scan
>> (by command, for example)
>> and it is not long - about several seconds. Meanwhile wpa_supplicant
>> "decides" to associate.
>> Command "join" (associate) has usually higher priority than scan for
>> wlan driver and it cancels scan.
> Wouldn't the driver indicate scan completed/aborted at that point? If
> not, the many driver_*.c have a timeout that is used to recover from
> unexpected driver behavior.

Yes, they are, but it is like 30 sec timeout.

>> So it makes sense to "clean" wpa_s->scanning flag and (maybe) notify
>> network manager that scan was canceled.
> So this is to address the case where association request is sent during
> an ongoing scan? If so, it sounds like it would be useful to get the
> scan notification handled somehow. This could be either through the
> driver indicating that the scan was stopped (e.g., in case of nl80211
> this is done with an NL80211_CMD_SCAN_ABORTED event). Alternatively,
> wpa_supplicant could clear the scan notification whenever requesting
> association. Either way, I don't think the correct place to do this
> would be in wpa_supplicant_cancel_scan() (which should really be called
> wpa_supplicant_cancel_scheduled_scan_req() from the view point of what
> it is doing).

It is just a good function that is called in all possible "Associate" places.
Also this change is harmful - in case of "no scan in progress" nothing
will happen.

> --
> Jouni Malinen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap

More information about the Hostap mailing list