--- wpa_supplicant-0.4.8/driver_wext.c~ 2006-02-27 21:41:24.000000000 +0000 +++ wpa_supplicant-0.4.8/driver_wext.c 2006-03-24 15:18:01.000000000 +0000 @@ -55,6 +55,10 @@ struct wpa_driver_wext_data { /* for set_auth_alg fallback */ int use_crypt; int auth_alg_fallback; + + u8 probed_ssid[IW_ESSID_MAX_SIZE]; + u8 probed_ssid_len; + }; @@ -872,6 +876,12 @@ int wpa_driver_wext_scan(void *priv, con iwr.u.data.flags = IW_SCAN_THIS_ESSID; } + /* If we probed for a specific SSID, remember it */ + drv->probed_ssid_len = ssid_len; + if (ssid_len) + memcpy(drv->probed_ssid, ssid, ssid_len); + + if (ioctl(drv->ioctl_sock, SIOCSIWSCAN, &iwr) < 0) { perror("ioctl[SIOCSIWSCAN]"); ret = -1; @@ -1032,9 +1042,16 @@ int wpa_driver_wext_get_scan_results(voi ssid_len > 0 && ssid_len <= IW_ESSID_MAX_SIZE) { if (ap_num < max_size) { - memcpy(results[ap_num].ssid, custom, - ssid_len); - results[ap_num].ssid_len = ssid_len; + if (ssid_len == 9 && drv->probed_ssid_len && + !memcmp(custom, "", 9)) { + memcpy(results[ap_num].ssid, drv->probed_ssid, drv->probed_ssid_len); + results[ap_num].ssid_len = drv->probed_ssid_len; + } else { + printf("found %d probed %d\n", ssid_len, drv->probed_ssid_len); + memcpy(results[ap_num].ssid, custom, + ssid_len); + results[ap_num].ssid_len = ssid_len; + } } } break;