No networks enabled - do not scan

Jouni Malinen jkmaline
Sat Dec 23 19:13:17 PST 2006

On Tue, Dec 19, 2006 at 01:32:29PM -0500, Dan Williams wrote:
> 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 should be fine.. wpa_supplicant scans if requested to with SCAN
ctrl_iface command.

> > 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.

Not scanning unless requested to is indeed a desired feature.

> 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.

Yes and that is there to allow explicit scan requests even if automatic
scans are disabled. I have not tested this with dbus, but this works
fine with an interface that is added with wpa_cli through the global

> 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.

Were you trying to add a wired interface? wpa_supplicant does not do
much internally with the knowledge of interface being wired.. As such,
requests to scan do indeed go through to the driver interface. Since
driver_wired is expected to be used with ap_scan=0, this is not much of
an issue since wpa_supplicant does not automatically requests scans in
this mode. If something external is trying to scan through ctrl_iface,
those will go through to the driver wrapper, but that will just fail in
the wired case.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list