From 30b8038921604e3d182d5bcfd042ddb6754b20cb Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 28 Sep 2012 22:01:48 +0300 Subject: [PATCH] P2P: Fix p2p_cancel processing during group formation The wpa_s->p2p_in_provisioning flag did not get cleared in some cases where p2p_cancel command is used to stop group formation. This can result in some operations (like p2p_find) failing afterwards. Fix this by using wpas_group_formation_completed() when processing p2p_cancel for a group that has not yet completed group formation. Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 089f109fa..996404752 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -5045,6 +5045,10 @@ int wpas_p2p_cancel(struct wpa_supplicant *wpa_s) found = 1; eloop_cancel_timeout(wpas_p2p_group_formation_timeout, wpa_s->parent, NULL); + if (wpa_s->p2p_in_provisioning) { + wpas_group_formation_completed(wpa_s, 0); + break; + } wpas_p2p_group_delete(wpa_s, P2P_GROUP_REMOVAL_REQUESTED); break;