[PATCH] STA: Fix AP connection drop issue when starting P2P scanning

赵兵 zhaobing
Tue Aug 13 05:56:14 PDT 2013


On Android, there is an issue of STA dropping from AP when P2P scanning.
Following is the reproduce steps:
1. Close WiFi
2. Open WiFi and wait for connecting to a saved AP
3. When AP connected, go into WiFi direct screen immediately
4. Wait for P2P scan for a while, the connection with AP will drop

The reproduce rate is almost 100%. The root cause is wpas_p2p_scan()
possibly triggers an AP scan if sta_scan_pending is set. At this time,
scan_req is 0 and ap_scan is 2. So wpa_supplicant_assoc_try() will be
invoked from wpa_supplicant_scan(). It disassoc current AP.

Signed-off-by: zhaobing <zhaobing at xiaomi.com>
---
wpa_supplicant/scan.c |??? 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index e662713..eb8e7d7 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -668,7 +668,8 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
??????????????? }
?????? }

-??????? if (scan_req != MANUAL_SCAN_REQ && wpa_s->conf->ap_scan == 2) {
+?????? if (scan_req != MANUAL_SCAN_REQ && wpa_s->conf->ap_scan == 2 &&
+?????? ???wpa_s->current_ssid == NULL) {
??????????????? wpa_s->connect_without_scan = NULL;
??????????????? wpa_s->prev_scan_wildcard = 0;
??????????????? wpa_supplicant_assoc_try(wpa_s, ssid);
-- 
1.7.9.5


Best regards,

Zhao Bing (??)
861060606666-5023
13693622077
MiTalk: 39682852
??????????68? ?????
The Rainbow City of China Resources ,NO.68,Qinghe Middle Street,Haidian District,Beijing,China




More information about the Hostap mailing list