aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-04-07 12:26:04 +0300
committerSteve Kondik <shade@chemlab.org>2014-06-12 14:08:46 -0700
commitd326112e76ace63faf7dd7b3ecccf57893e5688c (patch)
tree2a14f1475f78ce441d50ef7714c0431a9952dbc2
parente45c7631ab6b94baea49b1628c4b374b1024add9 (diff)
downloadandroid_external_wpa_supplicant_8-d326112e76ace63faf7dd7b3ecccf57893e5688c.tar.gz
android_external_wpa_supplicant_8-d326112e76ace63faf7dd7b3ecccf57893e5688c.tar.bz2
android_external_wpa_supplicant_8-d326112e76ace63faf7dd7b3ecccf57893e5688c.zip
P2P: Clear p2p_in_invitation on cancel
Commit 41d5ce9e0b7b37dd84fbf3c1aa5ed571c32321d4 added scan optimizations for P2P invitation cases. However, it left a path where the invitation state was not cleared and as such, introduced potential issues for following scans that ended up getting incorrectly optimized for a single channel regardless of parameters. Fix this by clearing p2p_in_invitation more carefully, especially on p2p_cancel command. p2p_cancel is now also run from the FLUSH command to avoid issues with hwsim test cases (e.g., persistent_group_per_sta_psk followed by ap_open_tdls resulted in an error due to p2p_in_invitation remaining set after FLUSH). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: f05cee9714ae87d315d893699a536b60a5aa73a9 Git-repo : git://w1.fi/srv/git/hostap.git Change-Id: I7eea172ca77faa43c0a93cfb5e0f2f542fb0959a CRs-fixed: 645171
-rw-r--r--wpa_supplicant/ctrl_iface.c1
-rw-r--r--wpa_supplicant/p2p_supplicant.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index fdffda85..d9d2363a 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5199,6 +5199,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
wpa_dbg(wpa_s, MSG_DEBUG, "Flush all wpa_supplicant state");
#ifdef CONFIG_P2P
+ wpas_p2p_cancel(wpa_s);
wpas_p2p_stop_find(wpa_s);
p2p_ctrl_flush(wpa_s);
wpas_p2p_group_remove(wpa_s, "*");
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 077a5a4a..9a4e42f9 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -778,6 +778,7 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
wpa_s->global->p2p_group_formation = NULL;
wpa_s->p2p_in_provisioning = 0;
}
+ wpa_s->p2p_in_invitation = 0;
if (!success) {
wpa_msg_global(wpa_s->parent, MSG_INFO,
@@ -5963,6 +5964,11 @@ int wpas_p2p_cancel(struct wpa_supplicant *wpa_s)
wpas_p2p_group_delete(wpa_s,
P2P_GROUP_REMOVAL_REQUESTED);
break;
+ } else if (wpa_s->p2p_in_invitation) {
+ wpa_printf(MSG_DEBUG, "P2P: Interface %s in invitation found - cancelling",
+ wpa_s->ifname);
+ found = 1;
+ wpas_p2p_group_formation_failed(wpa_s);
}
}
@@ -6152,6 +6158,7 @@ void wpas_p2p_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
wpa_s->p2p_go_group_formation_completed = 1;
wpa_s->global->p2p_group_formation = NULL;
wpa_s->p2p_in_provisioning = 0;
+ wpa_s->p2p_in_invitation = 0;
}
wpa_s->global->p2p_go_wait_client.sec = 0;
if (addr == NULL)