WEXT: Suppress additional DISASSOCIATE events

Change-Id: Id65428908bca59e71a3ab479b63d992eff96e433
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 0139478..f7df7cb 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -486,10 +486,19 @@
 				drv->assoc_req_ies = NULL;
 				os_free(drv->assoc_resp_ies);
 				drv->assoc_resp_ies = NULL;
+#ifdef ANDROID
+				if (!drv->skip_disconnect) {
+					drv->skip_disconnect = 1;
+#endif
 				wpa_supplicant_event(drv->ctx, EVENT_DISASSOC,
 						     NULL);
-			
+#ifdef ANDROID
+				}
+#endif
 			} else {
+#ifdef ANDROID
+				drv->skip_disconnect = 0;
+#endif
 				wpa_driver_wext_event_assoc_ies(drv);
 				wpa_supplicant_event(drv->ctx, EVENT_ASSOC,
 						     NULL);
@@ -2043,7 +2052,9 @@
 	int value;
 
 	wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
-
+#ifdef ANDROID
+	drv->skip_disconnect = 0;
+#endif
 	if (drv->cfg80211) {
 		/*
 		 * Stop cfg80211 from trying to associate before we are done