]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not blacklist the current AP on DISABLE_NETWORK
authorSunil Dutt <usdutt@qti.qualcomm.com>
Mon, 24 Apr 2017 10:01:05 +0000 (15:31 +0530)
committerJouni Malinen <j@w1.fi>
Sat, 29 Apr 2017 14:46:36 +0000 (17:46 +0300)
Disconnection due to DISABLE_NETWORK while being connected was resulting
in the AP getting blacklisted. Avoid this by setting own_disconnect_req
on a disconnect request due to DISABLE_NETWORK similarly to the
SELECT_NETWORK disconnection case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wpa_supplicant.c

index 6d8ef11c8d744c8b6c9e9e76a5d97feab54ce714..56cc35c564c37ed3f92e2f5598667cc6b031fa1b 100644 (file)
@@ -3149,13 +3149,19 @@ void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
                                wpas_notify_network_enabled_changed(
                                        wpa_s, other_ssid);
                }
-               if (wpa_s->current_ssid)
+               if (wpa_s->current_ssid) {
+                       if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
+                               wpa_s->own_disconnect_req = 1;
                        wpa_supplicant_deauthenticate(
                                wpa_s, WLAN_REASON_DEAUTH_LEAVING);
+               }
        } else if (ssid->disabled != 2) {
-               if (ssid == wpa_s->current_ssid)
+               if (ssid == wpa_s->current_ssid) {
+                       if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
+                               wpa_s->own_disconnect_req = 1;
                        wpa_supplicant_deauthenticate(
                                wpa_s, WLAN_REASON_DEAUTH_LEAVING);
+               }
 
                was_disabled = ssid->disabled;