2017-08-10 12:45:03

by Ganapathi Bhat

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
1.9.1


2017-08-10 12:47:30

by Ganapathi Bhat

[permalink] [raw]
Subject: [PATCH 2/2] mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan

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 <[email protected]>
---
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

2017-08-10 12:46:24

by Ganapathi Bhat

[permalink] [raw]
Subject: [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.

Signed-off-by: Ganapathi Bhat <[email protected]>
---
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

2017-08-17 07:00:11

by Kalle Valo

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

Ganapathi Bhat <[email protected]> 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 <[email protected]>

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