[PATCH] wpa_supplicant: work around for drivers lacking direct scan

Derek Taubert dtaubert
Fri Jan 27 14:41:34 PST 2006


This patch helps to find cloaked networks from wireless drivers that
don't support a direct scan (such as the ipw2200 pre-WIRELESS_EXT v18).
The association request causes the AP to respond, which is then picked
up by the scan.

It's a nice alternative to turning on ap_scan=2 because:
1) It can be turned on per network.
2) Explicit security policies aren't required.

Derek


diff -cdpNr wpa_supplicant-0.5.0.orig/config.c wpa_supplicant-0.5.0/config.c
*** wpa_supplicant-0.5.0.orig/config.c	2005-11-26 20:45:45.000000000 -0800
--- wpa_supplicant-0.5.0/config.c	2006-01-20 23:16:20.000000000 -0800
*************** static char * wpa_config_write_wep_key3(
*** 1004,1010 ****
   */
  static const struct parse_data ssid_fields[] = {
  	{ STR_RANGE(ssid, 0, MAX_SSID_LEN) },
! 	{ INT_RANGE(scan_ssid, 0, 1) },
  	{ FUNC(bssid) },
  	{ FUNC_KEY(psk) },
  	{ FUNC(proto) },
--- 1004,1010 ----
   */
  static const struct parse_data ssid_fields[] = {
  	{ STR_RANGE(ssid, 0, MAX_SSID_LEN) },
! 	{ INT_RANGE(scan_ssid, 0, 2) },
  	{ FUNC(bssid) },
  	{ FUNC_KEY(psk) },
  	{ FUNC(proto) },
diff -cdpNr wpa_supplicant-0.5.0.orig/wpa_supplicant.c wpa_supplicant-0.5.0/wpa_supplicant.c
*** wpa_supplicant-0.5.0.orig/wpa_supplicant.c	2005-12-10 20:47:00.000000000 -0800
--- wpa_supplicant-0.5.0/wpa_supplicant.c	2006-01-20 23:18:16.000000000 -0800
*************** static void wpa_supplicant_scan(void *el
*** 880,885 ****
--- 880,888 ----
  	wpa_printf(MSG_DEBUG, "Starting AP scan (%s SSID)",
  		   ssid ? "specific": "broadcast");
  	if (ssid) {
+ 		if (ssid->scan_ssid == 2) {
+ 			wpa_supplicant_associate(wpa_s, NULL, ssid);
+ 		}
  		wpa_hexdump_ascii(MSG_DEBUG, "Scan SSID",
  				  ssid->ssid, ssid->ssid_len);
  		wpa_s->prev_scan_ssid = ssid;




More information about the Hostap mailing list