mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 06:02:37 +01:00
station: Default to active scan if MAC randomization is present
This patch also simplifies the scan type selection logic.
This commit is contained in:
parent
55a7e9d82a
commit
80d4e9b572
@ -2002,6 +2002,12 @@ static void station_dbus_scan_triggered(int err, void *user_data)
|
|||||||
IWD_STATION_INTERFACE, "Scanning");
|
IWD_STATION_INTERFACE, "Scanning");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool station_needs_hidden_network_scan(struct station *station)
|
||||||
|
{
|
||||||
|
return !l_queue_isempty(station->hidden_bss_list_sorted) &&
|
||||||
|
known_networks_has_hidden();
|
||||||
|
}
|
||||||
|
|
||||||
static struct l_dbus_message *station_dbus_scan(struct l_dbus *dbus,
|
static struct l_dbus_message *station_dbus_scan(struct l_dbus *dbus,
|
||||||
struct l_dbus_message *message,
|
struct l_dbus_message *message,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
@ -2014,18 +2020,9 @@ static struct l_dbus_message *station_dbus_scan(struct l_dbus *dbus,
|
|||||||
if (station->scan_id)
|
if (station->scan_id)
|
||||||
return dbus_error_busy(message);
|
return dbus_error_busy(message);
|
||||||
|
|
||||||
/*
|
if (wiphy_can_randomize_mac_addr(station->wiphy) ||
|
||||||
* If we're not connected and no hidden networks are seen & configured,
|
station_needs_hidden_network_scan(station) ||
|
||||||
* use passive scanning to hide our MAC address
|
station->connected_bss) {
|
||||||
*/
|
|
||||||
if (!station->connected_bss &&
|
|
||||||
!(!l_queue_isempty(station->hidden_bss_list_sorted) &&
|
|
||||||
known_networks_has_hidden())) {
|
|
||||||
station->scan_id = scan_passive(index,
|
|
||||||
station_dbus_scan_triggered,
|
|
||||||
new_scan_results, station,
|
|
||||||
station_scan_destroy);
|
|
||||||
} else {
|
|
||||||
struct scan_parameters params;
|
struct scan_parameters params;
|
||||||
|
|
||||||
memset(¶ms, 0, sizeof(params));
|
memset(¶ms, 0, sizeof(params));
|
||||||
@ -2035,9 +2032,14 @@ static struct l_dbus_message *station_dbus_scan(struct l_dbus *dbus,
|
|||||||
params.randomize_mac_addr_hint = true;
|
params.randomize_mac_addr_hint = true;
|
||||||
|
|
||||||
station->scan_id = scan_active_full(index, ¶ms,
|
station->scan_id = scan_active_full(index, ¶ms,
|
||||||
station_dbus_scan_triggered,
|
station_dbus_scan_triggered,
|
||||||
new_scan_results, station,
|
new_scan_results, station,
|
||||||
station_scan_destroy);
|
station_scan_destroy);
|
||||||
|
} else {
|
||||||
|
station->scan_id = scan_passive(index,
|
||||||
|
station_dbus_scan_triggered,
|
||||||
|
new_scan_results, station,
|
||||||
|
station_scan_destroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!station->scan_id)
|
if (!station->scan_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user