No networks enabled - do not scan

Dan Williams dcbw
Tue Dec 19 10:32:29 PST 2006


On Mon, 2006-12-18 at 17:42 -0500, Dan Williams wrote:
> 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.

So my assertion here may be somewhat wrong.  I see that

	if (!enabled && !wpa_s->scan_req) {

should only suppress the scan if scan_req is 0.  Both the regular
control interface and the dbus control interface set scan_req to 2 when
they request a scan.

I also have now found out that wpa_supplicant is attempting to scan on
the wired interface too, which is quite odd, and is the real source of
this error message.  More investigation necessary to determine whether
the error is in wpa_supplicant or in my usage of it.

Dan

> 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;
> 
> 
> _______________________________________________
> HostAP mailing list
> HostAP at shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap





More information about the Hostap mailing list