diff options
author | Roshan Pius <rpius@google.com> | 2018-07-12 13:20:52 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2018-10-09 08:34:12 -0700 |
commit | c1c965934514ef0cdb7cd9e96f239673d0bb9a45 (patch) | |
tree | 78a7fa6dd23c5ad8a77c4d03d04f9a446d25d502 /wpa_supplicant | |
parent | e2d2101160479023eb565eee9d126ff4b2b4ebe3 (diff) | |
download | wpa_supplicant_8-c1c965934514ef0cdb7cd9e96f239673d0bb9a45.tar.gz |
wpa_supplicant(hidl): Turn on scan MAC randomization
Even though we moved scan handling to wificond, wpa_supplicant may
issue scans on its own in certain connection-related scenarios.
Ensure that we only use randomized scans in those cases on Android
devices.
Bug: 73642801
Test: Ensured that we can connect to wifi networks.
Test: Triggered scans via wpa_cli and ensured they use random MAC
addresses.
Change-Id: I95d0e021db7f4ec22ec13720f3a2de578e63f0a6
Diffstat (limited to 'wpa_supplicant')
-rw-r--r-- | wpa_supplicant/hidl/1.1/hidl_manager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wpa_supplicant/hidl/1.1/hidl_manager.cpp b/wpa_supplicant/hidl/1.1/hidl_manager.cpp index ca614d20..2798e35e 100644 --- a/wpa_supplicant/hidl/1.1/hidl_manager.cpp +++ b/wpa_supplicant/hidl/1.1/hidl_manager.cpp @@ -14,6 +14,7 @@ #include "misc_utils.h" extern "C" { +#include "scan.h" #include "src/eap_common/eap_sim_common.h" } @@ -470,6 +471,16 @@ int HidlManager::registerInterface(struct wpa_supplicant *wpa_s) } sta_iface_callbacks_map_[wpa_s->ifname] = std::vector<android::sp<ISupplicantStaIfaceCallback>>(); + // Turn on Android specific customizations for STA interfaces + // here! + // + // Turn on scan randomization. + if (wpas_mac_addr_rand_scan_set( + wpa_s, MAC_ADDR_RAND_SCAN, nullptr, nullptr)) { + wpa_printf( + MSG_ERROR, + "Failed to enable scan mac randomization"); + } } // Invoke the |onInterfaceCreated| method on all registered callbacks. |