No networks enabled - do not scan

Dan Williams dcbw
Mon Dec 18 14:42:37 PST 2006


This particular hunk [1] in wpa_supplicant presents a problem for
NetworkManager... First, NM must ask for scan results before it can tell
wpa_supplicant which network to use, of course, but wpa_supplicant
doesn't scan until it's told which network to use.  We lose.

This appears to work on the first scan request, because wpa_supplicant
does an initial scan automatically.  But thereafter, it does not scan
unless there's a configured network.  I understand why this is desirable
for standalone wpa_supplicant, but it certainly won't work with
NetworkManager.

Thoughts?

Dan

[1] wpa_supplicant.c:wpa_supplicant_scan, ~ line 1008

	if (wpa_s->disconnected)
		return;

	enabled = 0;
	ssid = wpa_s->conf->ssid;
	while (ssid) {
		if (!ssid->disabled) {
			enabled++;
			break;
		}
		ssid = ssid->next;
	}
	if (!enabled && !wpa_s->scan_req) {
		wpa_printf(MSG_DEBUG, "No enabled networks - do not scan");
		wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
		return;
	}
	scan_req = wpa_s->scan_req;
	wpa_s->scan_req = 0;






More information about the Hostap mailing list