Q: wpa_supplicant/scan.c: num_ssids+

Jouni Malinen j
Wed Sep 9 15:06:04 PDT 2009

On Wed, Sep 09, 2009 at 03:35:46PM +0200, Holger Schurig wrote:

>    if (ssid) {
>            wpa_s->prev_scan_ssid = ssid;
>            if (max_ssids > 1) {
>                    wpa_printf(MSG_DEBUG, "Include wildcard SSID in the "
>                               "scan request");
>                    params.num_ssids++;
>            }
>            wpa_printf(MSG_DEBUG, "Starting AP scan for specific SSID(s)");
>    } else {
>            wpa_s->prev_scan_ssid = WILDCARD_SSID_SCAN;
>            params.num_ssids++;
>            wpa_printf(MSG_DEBUG, "Starting AP scan for wildcard SSID");
>    }

> 1. Is the debug text simply misleading?  In my case, ssid is NULL, so
>    the else-part is taken. Here it babbles something about a wildcard
>    SSID scan, which is wrong.

I do not follow.. Your configuration is using scan_ssid=1 which means it
should be setting ssid. With driver_wext.c (i.e., with only one SSID per
scan request), this will end up alternating between broadcast and
per-SSID scans. The debug text looks correct to me.

> 2. Why is params.num_ssids++ in both cases incremented?  In the else-
>    case, it seems to be simply wrong.

Wildcard scan is added if there is room for it and it counts as an SSID
just like any other specific SSID which is why the else-case is also
increasing the count.

> 3. Why force a wild-card SSID scan at all?

It is there to optimize for the case where multiple networks are

> 4. Currently, driver_wext.c says "max_ssids = 1", so isn't forcing
>    a wild-card SSID scan via manipulating params.num_ssids bogus
>    in the first place?

It is not for driver_wext.c; only driver_nl80211.c uses multiple SSIDs
per scan and as such, has room for adding the wildcard entry each time.
Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list