From: Jouni Malinen Date: Thu, 4 Nov 2010 09:59:44 +0000 (+0200) Subject: P2P: Allow p2p_cancel to cancel P2P client that has not yet connected X-Git-Tag: hostap-1-bp~907 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0a9f3b02fb2682bb687503369dd93dc859e61f3;p=thirdparty%2Fhostap.git P2P: Allow p2p_cancel to cancel P2P client that has not yet connected This can now be used to cancel a P2P client interface that has not yet completed the first 4-way handshake with a GO. --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 251d00bae..447838a34 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3393,6 +3393,9 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s) ssid->ssid_len); os_memcpy(wpa_s->go_dev_addr, go_dev_addr, ETH_ALEN); + if (wpa_s->global->p2p_group_formation == wpa_s) + wpa_s->global->p2p_group_formation = NULL; + if (ssid->passphrase == NULL && ssid->psk_set) { char psk[65]; wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32); @@ -3751,7 +3754,9 @@ int wpas_p2p_cancel(struct wpa_supplicant *wpa_s) for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { if (wpa_s == global->p2p_group_formation && - wpa_s->p2p_in_provisioning) { + (wpa_s->p2p_in_provisioning || + wpa_s->parent->pending_interface_type == + WPA_IF_P2P_CLIENT)) { wpa_printf(MSG_DEBUG, "P2P: Interface %s in group " "formation found - cancelling", wpa_s->ifname);