]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Set state to DISCONNECTED on AP creation errors
authorDan Williams <dcbw@redhat.com>
Sun, 23 Sep 2012 10:55:58 +0000 (13:55 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 23 Sep 2012 10:55:58 +0000 (13:55 +0300)
If the AP creation failed (missing freq= or driver error) the supplicant
would previously stay in SCANNING state forever. Instead, it should
handle the error a bit better and drop back to DISCONNECTED so clients
know something went wrong.

Signed-hostap: Dan Williams <dcbw@redhat.com>
intended-for: hostap-1

wpa_supplicant/wpa_supplicant.c

index c212ed245b8f9755f1576368de2d5f9d909271c8..a036f3ec64f03e8e9894c245fabaf6f9385dc3c5 100644 (file)
@@ -1246,7 +1246,10 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                                "mode");
                        return;
                }
-               wpa_supplicant_create_ap(wpa_s, ssid);
+               if (wpa_supplicant_create_ap(wpa_s, ssid) < 0) {
+                       wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
+                       return;
+               }
                wpa_s->current_bss = bss;
 #else /* CONFIG_AP */
                wpa_msg(wpa_s, MSG_ERROR, "AP mode support not included in "