linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Avoid unnecessary usage of random_mac
@ 2017-08-10 12:41 Ganapathi Bhat
  2017-08-10 12:41 ` [PATCH 1/2] mwifiex: do not use random MAC for pre-association scanning Ganapathi Bhat
  2017-08-10 12:41 ` [PATCH 2/2] mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan Ganapathi Bhat
  0 siblings, 2 replies; 4+ messages in thread
From: Ganapathi Bhat @ 2017-08-10 12:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brian Norris, Cathy Luo, Nishant Sarmukadam, Xinming Hu,
	Mangesh Malusare, Zhiyuan Yang, Ganapathi Bhat

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(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] mwifiex: do not use random MAC for pre-association scanning
  2017-08-10 12:41 [PATCH 0/2] Avoid unnecessary usage of random_mac Ganapathi Bhat
@ 2017-08-10 12:41 ` Ganapathi Bhat
  2017-08-17  7:00   ` [1/2] " Kalle Valo
  2017-08-10 12:41 ` [PATCH 2/2] mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan Ganapathi Bhat
  1 sibling, 1 reply; 4+ messages in thread
From: Ganapathi Bhat @ 2017-08-10 12:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brian Norris, Cathy Luo, Nishant Sarmukadam, Xinming Hu,
	Mangesh Malusare, Zhiyuan Yang, 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.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/scan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index d8e8b85..79b4aff 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -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;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan
  2017-08-10 12:41 [PATCH 0/2] Avoid unnecessary usage of random_mac Ganapathi Bhat
  2017-08-10 12:41 ` [PATCH 1/2] mwifiex: do not use random MAC for pre-association scanning Ganapathi Bhat
@ 2017-08-10 12:41 ` Ganapathi Bhat
  1 sibling, 0 replies; 4+ messages in thread
From: Ganapathi Bhat @ 2017-08-10 12:41 UTC (permalink / raw)
  To: linux-wireless
  Cc: Brian Norris, Cathy Luo, Nishant Sarmukadam, Xinming Hu,
	Mangesh Malusare, Zhiyuan Yang, 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.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/scan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 79b4aff..c9d41ed 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -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;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [1/2] mwifiex: do not use random MAC for pre-association scanning
  2017-08-10 12:41 ` [PATCH 1/2] mwifiex: do not use random MAC for pre-association scanning Ganapathi Bhat
@ 2017-08-17  7:00   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-08-17  7:00 UTC (permalink / raw)
  To: Ganapathi Bhat
  Cc: linux-wireless, Brian Norris, Cathy Luo, Nishant Sarmukadam,
	Xinming Hu, Mangesh Malusare, Zhiyuan Yang, Ganapathi Bhat

Ganapathi Bhat <gbhat@marvell.com> wrote:

> 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.
> 
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

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

-- 
https://patchwork.kernel.org/patch/9893639/

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-17  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 12:41 [PATCH 0/2] Avoid unnecessary usage of random_mac Ganapathi Bhat
2017-08-10 12:41 ` [PATCH 1/2] mwifiex: do not use random MAC for pre-association scanning Ganapathi Bhat
2017-08-17  7:00   ` [1/2] " Kalle Valo
2017-08-10 12:41 ` [PATCH 2/2] mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan Ganapathi Bhat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).