diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-02-19 18:10:20 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-02-19 18:10:20 +0200 |
commit | a7a30b90e59e7c9f9db5ec5db6190a0fba4fc37e (patch) | |
tree | 94cc4c2a5a633478048004a6766adf70e935cfc9 | |
parent | 2c60ca73912fe30344df072ca6447f1a4dcdb67b (diff) | |
download | external_wpa_supplicant_8_ti-a7a30b90e59e7c9f9db5ec5db6190a0fba4fc37e.zip external_wpa_supplicant_8_ti-a7a30b90e59e7c9f9db5ec5db6190a0fba4fc37e.tar.gz external_wpa_supplicant_8_ti-a7a30b90e59e7c9f9db5ec5db6190a0fba4fc37e.tar.bz2 |
P2P: Fix group idle timer cancellation on group removal
The wpas_p2p_group_idle_timeout was getting cancelled in the beginning
of wpas_p2p_group_delete(). However, in the case of P2P client role,
this function called wpa_supplicant_deauthenticate() next and that ended
up changing state to WPA_DISCONNECTED which resulted in
wpas_p2p_notif_disconnected() rescheduling the timeout. This left the
unexpected timeout behind after the group was removed. If another group
operation was started within P2P_MAX_CLIENT_IDLE (10) seconds, that
timeout could end up terminating the group while it was still being set
up.
Fix this by reordering wpas_p2p_group_delete() to cancel the group idle
timeout only after having called wpa_supplicant_deauthenticate(). The
group idle timeout is still rescheduled, but it gets removed immediately
afterwards when the actual group information is being cleared.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 015e6b4..121f602 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -213,8 +213,6 @@ static void wpas_p2p_group_delete(struct wpa_supplicant *wpa_s) char *gtype; const char *reason; - eloop_cancel_timeout(wpas_p2p_group_idle_timeout, wpa_s, NULL); - ssid = wpa_s->current_ssid; if (ssid == NULL) { /* @@ -264,6 +262,8 @@ static void wpas_p2p_group_delete(struct wpa_supplicant *wpa_s) wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_REMOVED "%s %s%s", wpa_s->ifname, gtype, reason); + eloop_cancel_timeout(wpas_p2p_group_idle_timeout, wpa_s, NULL); + if (ssid) wpas_notify_p2p_group_removed(wpa_s, ssid, gtype); |