dbus: Fix passive/active scans in some cases

Currently the DBus Interface.Scan API is counter-intuitive. It issues
ProbeRequests when doing passive scans when channels are specified, and
does not issue ProbeRequests for broadcast active scans.

This patch updates DBus API .Scan() logic per the test cases listed below:

 1) Interface.Scan({'Type':'passive'})
    Request:     Passive scan (all channels)
    Should be:   No ProbeRequests; Passive Scan results for all channels
    Previous:    1 ProbeRequest on all channels for both broadcast SSID and
	selected network (scan_ssid=1)
    This Patch:  --No change--: 1 ProbeRequest on all channels for both
	broadcast SSID and selected network (scan_ssid=1)

 2) Interface.Scan({'Type':'passive', 'Channel':(2412, 20)})
    Request:     Passive scan (1 channel)
    Should be:   No ProbeRequests; Passive Scan results for 1 channel
	(plus overlapping channels)
    Previous:    1 broadcast ProbeRequest on specified channel
    This Patch:  --Fixed--: No ProbeRequests; Passive Scan results for 1
	channel (plus overlapping channels)

 3) Interface.Scan({'Type':'active'})
    Request:     Active scan with no SSIDs (all channels)
    Should be:   1 broadcast ProbeRequest on all channels
    Previous:    No ProbeRequests;  passive scan results for all channels
    This Patch:  --Fixed--: 1 broadcast ProbeRequest on all channels

 4) Interface.Scan({'Type':'active', 'Channel':(2412, 20)})
    Request:     Active scan with no SSIDs (1 channel)
    Should be:   1 broadcast ProbeRequest on specified channel
    Previous:    No ProbeRequests; Passive scan results for specified
	channel (plus overlapping channels)
    This Patch:  --Fixed--: 1 broadcast ProbeRequest on specified channel
This commit is contained in:
Daniel Kurtz 2010-10-09 16:22:39 +03:00 committed by Jouni Malinen
parent 257a515295
commit a7af023b84

View file

@ -1260,14 +1260,16 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
"passive scan"); "passive scan");
goto out; goto out;
} else if (params.freqs && params.freqs[0]) { } else if (params.freqs && params.freqs[0]) {
/* wildcard ssid */
params.num_ssids++;
wpa_supplicant_trigger_scan(wpa_s, &params); wpa_supplicant_trigger_scan(wpa_s, &params);
} else { } else {
wpa_s->scan_req = 2; wpa_s->scan_req = 2;
wpa_supplicant_req_scan(wpa_s, 0, 0); wpa_supplicant_req_scan(wpa_s, 0, 0);
} }
} else if (!os_strcmp(type, "active")) { } else if (!os_strcmp(type, "active")) {
if (!params.num_ssids) {
/* Add wildcard ssid */
params.num_ssids++;
}
wpa_supplicant_trigger_scan(wpa_s, &params); wpa_supplicant_trigger_scan(wpa_s, &params);
} else { } else {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "