Created attachment 246653 [details] Change IEEE80211_IOC_SCAN_MAX_SSID to match IEEE80211_SCAN_MAX_SSID v1 Ioctl for scan requests takes up to IEEE80211_IOC_SCAN_MAX_SSID (3) ssid's, but scan module defines maximum supported SSID's for scan (IEEE80211_SCAN_MAX_SSID) as 1, and throws away everything above that. IEEE80211_IOC_SCAN_MAX_SSID (3) define is picked up by wpa_supplicant in base to export this as BSD driver maximum scan ssids. Suggested patch changes IEEE80211_IOC_SCAN_MAX_SSID to 1. Other option would be to make it other way around, changing IEEE80211_SCAN_MAX_SSID to 3, but it seems that iwi driver is capable of 1 directed scan maximum - not sure if this show-stopper.
If you look at net80211::ieee80211_scanreq(): you'll find the following comment: /* NB: silently reduce ssid count to what is supported */ It's hard to say (given the huge updates pushed back then) why the IOC version was introduced but it seems it was done on purpose. The hostap history says it was done for FreeBSD 8 support: 88487b0e0b524aae7603c17b7db7985ae9a810c9 If you look further at the code, you'll find that despite being capped (further down the stack, e.g. down to ieee80211_scan_copy_ssid()) the number of SSIDs is passed down. If you look further in scan_curchan()/ieee80211_swscan_probe_curchan() you can see that it would send a probe request per SSID and that matches the comment in ieee80211_scan.h. But that code was there before already. Seems to have come in with 68e8e04e93c1ec3d37022223b69073f50d3d4981. I wonder if this is missing follow-up work to finish it given modern hardware can probe 16/20/.. SSIDs?
I didn't emphasize it in original report, but my main concern is that this define is picked up by wpa_supplicant, and then it's exported as MaxScanSSID driver capability, so consumers of wpa_supplicant dbus interface will pick it up and users will believe that (for example) iwm(4) will issue 3 probe requests, but in reality it will be only 1. So - my patch is just tidying up the API. I currently have no plans to make a patch to bump it to 16/20.