]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use minimal scan delay upon EVENT_INTERFACE_ADDED
authorArend van Spriel <arend@broadcom.com>
Wed, 15 Jan 2014 09:11:33 +0000 (10:11 +0100)
committerJouni Malinen <j@w1.fi>
Fri, 17 Jan 2014 09:50:31 +0000 (11:50 +0200)
This patch resets the static interface_count to zero in case of
wpa_supplicant_driver_init() call for wpa_s which is in
INTERFACE_DISABLED state. This interface_count is used for the delay of
the scan which is now minimal for dynamically added interfaces. This may
collide with a scan for another interface, but the same is true for any
chosen delay in this scenario. Also the state change to DISCONNECTED is
moved to wpa_supplicant_driver_init() so it will move from
INTERFACE_DISABLED to INACTIVE when there are no enabled networks.

Tested-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index 632f0fe01708f3082b646c9b512d33f99af08c9c..2121bf0146fedd3f2545283cb4c8f5c966ac2ec2 100644 (file)
@@ -2311,7 +2311,6 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
                        wpa_msg(wpa_s, MSG_INFO, "Failed to initialize the "
                                "driver after interface was added");
                }
-               wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
                break;
        case EVENT_INTERFACE_REMOVED:
                wpa_dbg(wpa_s, MSG_DEBUG, "Configured interface was removed");
index b7c16caaf7d31761038e3f279df7e3018c501ab6..aa9c32d6d9d55eaf38728156db22cc1a78ee38ba 100644 (file)
@@ -2623,6 +2623,10 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
        wpa_s->prev_scan_wildcard = 0;
 
        if (wpa_supplicant_enabled_networks(wpa_s)) {
+               if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+                       wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
+                       interface_count = 0;
+               }
                if (wpa_supplicant_delayed_sched_scan(wpa_s, interface_count,
                                                      100000))
                        wpa_supplicant_req_scan(wpa_s, interface_count,