Skip to contentSkip to conversation

Avoid unnecessary usage of random_mac

PATCH In review Ganapathi Bhat 2 participants 4 messages Aug 10, 2017 – Aug 17, 2017 Marvell mwifiex wireless driver

lore
Share & tools
lore
#0 lore raw

cover Avoid unnecessary usage of random_mac

This patch series addresses unnecessary usage of random_mac from user scan_request.

Ganapathi Bhat (2):
mwifiex: do not use random MAC for pre-association scanning
mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID
scan

 drivers/net/wireless/marvell/mwifiex/scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 mwifiex: do not use random MAC for pre-association scanning

Driver should use random MAC address only if the scan is requested by user(provided NL80211_SCAN_FLAG_RANDOM_ADDR is set in scan request). It should not be used for a scan performed before association.

---
 drivers/net/wireless/marvell/mwifiex/scan.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/scan.c +0 -1
index d8e8b85..79b4aff 100644
@@ -2790,7 +2790,6 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv,
 	if (!scan_cfg)
 		return -ENOMEM;
 
-	ether_addr_copy(scan_cfg->random_mac, priv->random_mac);
 	scan_cfg->ssid_list = req_ssid;
 	scan_cfg->num_ssids = 1;
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/2 mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan

In reply to Ganapathi Bhat

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.

---
 drivers/net/wireless/marvell/mwifiex/scan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/scan.c +2 -1
index 79b4aff..c9d41ed 100644
@@ -1947,7 +1947,8 @@ static void mwifiex_complete_scan(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;
 
Signature · 1 line
1.9.1
#2 lore raw

Re: [1/2] mwifiex: do not use random MAC for pre-association scanning

In reply to Ganapathi Bhat
Quoted 6 lines · Ganapathi Bhat

Driver should use random MAC address only if the scan is requested by user(provided NL80211_SCAN_FLAG_RANDOM_ADDR is set in scan request). It should not be used for a scan performed before association.

2 patches applied to wireless-drivers-next.git, thanks.

2af2c2c77e5a mwifiex: do not use random MAC for pre-association scanning 89001c1c8dc3 mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan

Signature · 3 lines
https://patchwork.kernel.org/patch/9893639/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches