From: Jouni Malinen Date: Thu, 9 Oct 2014 22:31:57 +0000 (+0300) Subject: P2P: Report group removal reason PSK_FAILURE in timeout case X-Git-Tag: hostap_2_4~1370 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=debb2dacac41405584191fa8dd04ad095d115ce9;p=thirdparty%2Fhostap.git P2P: Report group removal reason PSK_FAILURE in timeout case It was possible for group formation timeout to be the trigger for detecting the second PSK/4-way handshake failure. If that happened, the special reason=PSK_FAILURE was not used in the P2P-GROUP-REMOVED event even though P2P-PERSISTENT-PSK-FAIL did get reported. Fix this special case by replacing the reason code with PSK_FAILURE if the PSK failure timeout gets registed as part of the disconnection processing in the formation timeout handler. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 70a638293..d19efa25e 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -467,8 +467,17 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s, if (removal_reason != P2P_GROUP_REMOVAL_SILENT && ssid) wpas_notify_p2p_group_removed(wpa_s, ssid, gtype); - if (os_strcmp(gtype, "client") == 0) + if (os_strcmp(gtype, "client") == 0) { wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); + if (eloop_is_timeout_registered(wpas_p2p_psk_failure_removal, + wpa_s, NULL)) { + wpa_printf(MSG_DEBUG, + "P2P: PSK failure removal was scheduled, so use PSK failure as reason for group removal"); + removal_reason = P2P_GROUP_REMOVAL_PSK_FAILURE; + eloop_cancel_timeout(wpas_p2p_psk_failure_removal, + wpa_s, NULL); + } + } if (wpa_s->cross_connect_in_use) { wpa_s->cross_connect_in_use = 0;