]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Allow scans triggered by D-Bus to use MAC address randomization
authorEric Caruso <ejcaruso@chromium.org>
Thu, 17 Oct 2019 23:03:52 +0000 (16:03 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 27 Oct 2019 17:50:22 +0000 (19:50 +0200)
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 <ejcaruso@chromium.org>
wpa_supplicant/scan.c

index fe0d154f2ba753e53fb2922dddffe8a6c6650413..4d158a9c66daf2656b13ebaac114a8e85b766442 100644 (file)
@@ -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");