Patch for wpa_supplicant multiple networks when ap_scan = 2

Jouni Malinen jkmaline at
Thu May 26 23:31:34 EDT 2005

On Thu, May 19, 2005 at 06:11:31AM -0400, Brian Hill wrote:

> I made a very crude patch to wpa_supplicant.c that will let the
> supplicant scan through multiple networks in priority order, even when
> ap_scan = 2.  It's not well done, it's what I could do in just a few
> minutes to make it work for me.  I'd certainly appreciate any feedback
> if someone finds this useful / badly broken / stupid / funny.

Thanks! This is similar to what I planned on doing for ap_scan=2 mode
(for bugzilla bug 16). However, your patch has couple of issues that
make it fail in some cases. last_prio_scan would have been shared by
multiple interfaces if wpa_supplicant is controlling more than one
radio. In addition, it did not seem to scan all network blocks if more
than one block was sharing the same priority value.

I ended up using the same code that scan_ssid=1 had for iterating
through the networks. This means that ap_scan=2 will not use the
priority field; instead the order of network blocks in the file is used
to select which network to "scan for". In other words, this would match
with the order that ap_scan=1 mode use if all networks were using
scan_ssid=1 and APs were configured to use hidden SSIDs. These changes
are now in CVS.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list