Fix AP mode in wpa_supplicant with interface events
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 6 Oct 2010 14:10:07 +0000 (17:10 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 6 Oct 2010 14:10:07 +0000 (17:10 +0300)
Needs to not trigger a scan here when the AP mode setup sets
interface down/up.

wpa_supplicant/events.c

index dfded7d..e16b45f 100644 (file)
@@ -1805,9 +1805,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
        case EVENT_INTERFACE_ENABLED:
                wpa_printf(MSG_DEBUG, "Interface was enabled");
                if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
-                       wpa_supplicant_set_state(wpa_s,
-                                                WPA_DISCONNECTED);
-                       wpa_supplicant_req_scan(wpa_s, 0, 0);
+                       if (!wpa_s->ap_iface) {
+                               wpa_supplicant_set_state(wpa_s,
+                                                        WPA_DISCONNECTED);
+                               wpa_supplicant_req_scan(wpa_s, 0, 0);
+                       } else
+                               wpa_supplicant_set_state(wpa_s,
+                                                        WPA_COMPLETED);
                }
                break;
        case EVENT_INTERFACE_DISABLED: