aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2014-01-15 09:11:33 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-17 09:50:31 (GMT)
commita0e9d89203d9dfdf80fc807327b05a0bb4d355c7 (patch)
tree2ad16f8ade43d4a5e3c5d7b37bfcb867d03e3ebf /wpa_supplicant
parent5ddd07cb37811718e21f9ab2611d3dcdc554f4b9 (diff)
downloadhostap-a0e9d89203d9dfdf80fc807327b05a0bb4d355c7.zip
hostap-a0e9d89203d9dfdf80fc807327b05a0bb4d355c7.tar.gz
hostap-a0e9d89203d9dfdf80fc807327b05a0bb4d355c7.tar.bz2
Use minimal scan delay upon EVENT_INTERFACE_ADDED
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>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/events.c1
-rw-r--r--wpa_supplicant/wpa_supplicant.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 632f0fe..2121bf0 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -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");
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index b7c16ca..aa9c32d 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -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,