diff options
author | Srinivas Dasari <dasaris@qti.qualcomm.com> | 2016-11-21 12:10:36 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2016-11-25 20:52:39 (GMT) |
commit | 346b333d9a57155e5a32a31d951ada38b3c899fc (patch) | |
tree | 18c4ab033144f5925340d0c34d1cf9dc9b457bcb /wpa_supplicant | |
parent | afe280539b52e88ffdddb3507b448a14271153cc (diff) | |
download | hostap-346b333d9a57155e5a32a31d951ada38b3c899fc.zip hostap-346b333d9a57155e5a32a31d951ada38b3c899fc.tar.gz hostap-346b333d9a57155e5a32a31d951ada38b3c899fc.tar.bz2 |
Use random MAC address for scanning only in non-connected state
cfg80211 rejects the scans issued with random MAC address if the STA is
in connected state. This resulted in failures when using MAC_RAND_SCAN
while connected (CTRL-EVENT-SCAN-FAILED ret=-95). Enable random MAC
address functionality only if the STA is not in connected state to avoid
this. The real MAC address of the STA is already revealed in the
association, so this is an acceptable fallback mechanism for now.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r-- | wpa_supplicant/scan.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 172772d..5698443 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1047,7 +1047,8 @@ ssid_list_set: } #endif /* CONFIG_P2P */ - if (wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_SCAN) { + if ((wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_SCAN) && + wpa_s->wpa_state <= WPA_SCANNING) { params.mac_addr_rand = 1; if (wpa_s->mac_addr_scan) { params.mac_addr = wpa_s->mac_addr_scan; @@ -1469,7 +1470,8 @@ scan: wpa_setband_scan_freqs(wpa_s, scan_params); - if (wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_SCHED_SCAN) { + if ((wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_SCHED_SCAN) && + wpa_s->wpa_state <= WPA_SCANNING) { params.mac_addr_rand = 1; if (wpa_s->mac_addr_sched_scan) { params.mac_addr = wpa_s->mac_addr_sched_scan; @@ -2524,7 +2526,8 @@ int wpas_start_pno(struct wpa_supplicant *wpa_s) params.freqs = wpa_s->manual_sched_scan_freqs; } - if (wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_PNO) { + if ((wpa_s->mac_addr_rand_enable & MAC_ADDR_RAND_PNO) && + wpa_s->wpa_state <= WPA_SCANNING) { params.mac_addr_rand = 1; if (wpa_s->mac_addr_pno) { params.mac_addr = wpa_s->mac_addr_pno; |