From acdd0fc84f01d8b5e8aa39d6e4573cee0b5ac707 Mon Sep 17 00:00:00 2001 From: Deepthi Gowri Date: Sat, 5 Oct 2013 17:54:52 -0700 Subject: [PATCH] P2P: Clear p2p_group_formation and p2p_in_provisioning on group removal Commit 41f853235fe1d1fad1acecc0ee5dfe81c872c6b2 extends group formation timeout for the first data connection to complete and resets p2p_go_group_formation_completed flag due to which p2p_in_provisioning and p2p_group_formation flags are not cleared when wpas_group_formation_completed() is called. This can result in both station scan and p2p_find failures in the case where separate P2P group interface is not used and the client does not complete 4-way handshake. Fix this by clearing p2p_group_formation and p2p_in_provisioning when such a P2P group is deleted. Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 29de880c5..aec069b34 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -443,6 +443,11 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s, return 1; } + if (!wpa_s->p2p_go_group_formation_completed) { + wpa_s->global->p2p_group_formation = NULL; + wpa_s->p2p_in_provisioning = 0; + } + wpa_printf(MSG_DEBUG, "P2P: Remove temporary group network"); if (ssid && (ssid->p2p_group || ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION ||