aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-11-04 09:59:44 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-04 09:59:44 (GMT)
commita0a9f3b02fb2682bb687503369dd93dc859e61f3 (patch)
treea0050a60f92ffe65de450ccf52a0ad4ae38fe704
parent534525ff0519076079b85e26192c5b26b6d61381 (diff)
downloadhostap-a0a9f3b02fb2682bb687503369dd93dc859e61f3.zip
hostap-a0a9f3b02fb2682bb687503369dd93dc859e61f3.tar.gz
hostap-a0a9f3b02fb2682bb687503369dd93dc859e61f3.tar.bz2
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.
-rw-r--r--wpa_supplicant/p2p_supplicant.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 251d00b..447838a 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);