mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan
authorGanapathi Bhat <gbhat@marvell.com>
Thu, 10 Aug 2017 12:41:26 +0000 (18:11 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 17 Aug 2017 06:59:40 +0000 (09:59 +0300)
At the end of user scan request, driver will perform an active
scan for hidden SSIDs in passive channels. While doing this,
driver unconditionally adding random_mac in scan command, which
is no expected. It should add random_mac only if scan_request
has NL80211_SCAN_FLAG_RANDOM_ADDR flag set.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/scan.c

index 79b4aff3509ee76e27e48484b43a88f257a47de5..c9d41ed77fc75d8970d3db34c2a32146ae8487c6 100644 (file)
@@ -1947,7 +1947,8 @@ mwifiex_active_scan_req_for_passive_chan(struct mwifiex_private *priv)
        }
 
        adapter->active_scan_triggered = true;
-       ether_addr_copy(user_scan_cfg->random_mac, priv->random_mac);
+       if (priv->scan_request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR)
+               ether_addr_copy(user_scan_cfg->random_mac, priv->random_mac);
        user_scan_cfg->num_ssids = priv->scan_request->n_ssids;
        user_scan_cfg->ssid_list = priv->scan_request->ssids;