Message ID | 20140307002308.89E5B1A1F62@zqiu.mtv.corp.google.com |
---|---|
State | Superseded |
Headers | show |
I'm against this patch in mainline wpa_supplicant, it seems to be just for your use case. Also, I think that your problem is already solved: if you know that you only have one access point, why don't you use scan_freq? Excerpt from the demo wpa_supplicant.conf: # scan_freq: List of frequencies to scan # Space-separated list of frequencies in MHz to scan when searching for this # BSS. If the subset of channels used by the network is known, this option can # be used to optimize scanning to not occur on channels that the network does # not use. Example: scan_freq=2412 2437 2462 For my usage scenarior (where I have a multitude of APs and might move around) your patch would make thinks quite bad.
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index f7eb537..9926e10 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -665,6 +665,30 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) * wildcard SSID. */ ssid = NULL; + } else if (wpa_s->reassociate && wpa_s->current_ssid != NULL) { + /* + * Perform single-channel single-SSID scan for reassociate + * operation. + */ + /* Setup SSID */ + ssid = wpa_s->current_ssid; + wpa_hexdump_ascii(MSG_DEBUG, "Scan SSID", + ssid->ssid, ssid->ssid_len); + params.ssids[0].ssid = ssid->ssid; + params.ssids[0].ssid_len = ssid->ssid_len; + params.num_ssids = 1; + + /* + * Allocate memory for frequency array, allocate one extra + * slot for the zero-terminator. + */ + params.freqs = (int *)os_malloc(sizeof(int)*2); + if (params.freqs == NULL) { + wpa_dbg(wpa_s, MSG_ERROR, "Memory allocation failed"); + return; + } + params.freqs[0] = wpa_s->assoc_freq; + params.freqs[1] = 0; } else { struct wpa_ssid *start = ssid, *tssid; int freqs_set = 0;