aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-08 20:39:18 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-08 20:43:48 (GMT)
commit635874b55ad84bcd3e846bb16de50a3c3aacfa06 (patch)
tree1c2f62c1c5380614beed3013a1b37385197e7b32 /wpa_supplicant/events.c
parent8f2cf379233bf4e8fc5580c7a03858a7b5581368 (diff)
downloadhostap-635874b55ad84bcd3e846bb16de50a3c3aacfa06.zip
hostap-635874b55ad84bcd3e846bb16de50a3c3aacfa06.tar.gz
hostap-635874b55ad84bcd3e846bb16de50a3c3aacfa06.tar.bz2
Handle interface disabled/enabled more consistently
It was possible for the interface not to be marked in INTERFACE_DISABLED state in case the event was processed for P2P GO because the wpa_s instance could have been removed in case of a separate group interface. Change the state first to avoid leaving different state for the case where separate group interface is not used. Mark scan to be a normal scan on INTERFACE_ENABLED so that scanning rules (e.g., skip scan if no networks enabled) get used consistently. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 3c295c8..7f90393 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3379,6 +3379,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
if (!wpa_s->ap_iface) {
wpa_supplicant_set_state(wpa_s,
WPA_DISCONNECTED);
+ wpa_s->scan_req = NORMAL_SCAN_REQ;
wpa_supplicant_req_scan(wpa_s, 0, 0);
} else
wpa_supplicant_set_state(wpa_s,
@@ -3396,6 +3397,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
(wpa_s->current_ssid && wpa_s->current_ssid->p2p_group &&
wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO)) {
/*
+ * Mark interface disabled if this happens to end up not
+ * being removed as a separate P2P group interface.
+ */
+ wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
+ /*
* The interface was externally disabled. Remove
* it assuming an external entity will start a
* new session if needed.
@@ -3405,6 +3411,10 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
wpas_p2p_interface_unavailable(wpa_s);
else
wpas_p2p_disconnect(wpa_s);
+ /*
+ * wpa_s instance may have been freed, so must not use
+ * it here anymore.
+ */
break;
}
if (wpa_s->p2p_scan_work && wpa_s->global->p2p &&