dbus: Fix passive/active scans in some cases
authorDaniel Kurtz <djkurtz@google.com>
Sat, 9 Oct 2010 13:22:39 +0000 (16:22 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 9 Oct 2010 13:22:39 +0000 (16:22 +0300)
commita7af023b84bd2bd8f3bd1f91db7fab83b58d6539
treea770ab82e811d55fa4cb5f07a009b78bf6e7e111
parent257a51529511dfab9ec3162384a90532cbbe9cd7
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
wpa_supplicant/dbus/dbus_new_handlers.c