From 9fde14607091c6720f9705f38142d74bc26d669d Mon Sep 17 00:00:00 2001 From: Eric Caruso Date: Thu, 17 Oct 2019 16:03:52 -0700 Subject: [PATCH] Allow scans triggered by D-Bus to use MAC address randomization wpas_dbus_handler_scan() constructs a set of 'params' each time, but it doesn't acknowledge the existing randomization settings when doing so. That means that any D-Bus initiated scans weren't going to follow the configured settings. Signed-off-by: Eric Caruso --- wpa_supplicant/scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index fe0d154f2..4d158a9c6 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -196,6 +196,10 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit) return; } + if ((wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_SCAN) && + wpa_s->wpa_state <= WPA_SCANNING) + wpa_setup_mac_addr_rand_params(params, wpa_s->mac_addr_scan); + if (wpas_update_random_addr_disassoc(wpa_s) < 0) { wpa_msg(wpa_s, MSG_INFO, "Failed to assign random MAC address for a scan");