aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2017-04-05 18:26:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-25 09:44:34 -0400
commit385eb9b33e1d67704c66f2ac2632ebf723e87892 (patch)
treea362e338329d331f2d64c980bea976d61f0a5072 /drivers/net/wireless
parent444df795edf433aa75f10fc62ae171996dbd833c (diff)
mwifiex: MAC randomization should not be persistent
commit 7e2f18f06408ff56d7f75e68de8064777137b319 upstream. nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan request that should be randomized; the absence of such a flag means we should not randomize. However, mwifiex was stashing the latest randomization request and *always* using it for future scans, even those that didn't set the flag. Let's zero out the randomization info whenever we get a scan request without NL80211_SCAN_FLAG_RANDOM_ADDR. I'd prefer to remove priv->random_mac entirely (and plumb the randomization MAC properly through the call sequence), but the spaghetti is a little difficult to unravel here for me. Fixes: c2a8f0ff9c6c ("mwifiex: support random MAC address for scanning") Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/cfg80211.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 16241d21727b..afdbbf59a278 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -2512,9 +2512,11 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,
2512 priv->random_mac[i] |= get_random_int() & 2512 priv->random_mac[i] |= get_random_int() &
2513 ~(request->mac_addr_mask[i]); 2513 ~(request->mac_addr_mask[i]);
2514 } 2514 }
2515 ether_addr_copy(user_scan_cfg->random_mac, priv->random_mac);
2516 } else {
2517 eth_zero_addr(priv->random_mac);
2515 } 2518 }
2516 2519
2517 ether_addr_copy(user_scan_cfg->random_mac, priv->random_mac);
2518 user_scan_cfg->num_ssids = request->n_ssids; 2520 user_scan_cfg->num_ssids = request->n_ssids;
2519 user_scan_cfg->ssid_list = request->ssids; 2521 user_scan_cfg->ssid_list = request->ssids;
2520 2522