aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-12-21 11:35:18 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-21 11:35:18 (GMT)
commitd9bdba9f867577ed9da6df9c5c933033c71bcdf2 (patch)
treeff18dec556a4f550fa8cdc2878581e94c05e58ae
parent72d48a80ec5ccdb4d3aecd7c94a0e11a4db549b4 (diff)
downloadhostap-d9bdba9f867577ed9da6df9c5c933033c71bcdf2.zip
hostap-d9bdba9f867577ed9da6df9c5c933033c71bcdf2.tar.gz
hostap-d9bdba9f867577ed9da6df9c5c933033c71bcdf2.tar.bz2
P2P: Do not allow pending listen command override connect
If p2p_listen is issued during a p2p_scan, a pending after-scan operation is scheduled. However, since there is support for only a single pending operation, this was able to override a previously scheduled pending connect command. This can break some command sequences, so give higher priority to pending connect operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--src/p2p/p2p.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index c0009ce..9fcc6ca 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -251,6 +251,12 @@ int p2p_listen(struct p2p_data *p2p, unsigned int timeout)
p2p->pending_listen_usec = (timeout % 1000) * 1000;
if (p2p->p2p_scan_running) {
+ if (p2p->start_after_scan == P2P_AFTER_SCAN_NOTHING) {
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
+ "P2P: p2p_scan running - connect is already "
+ "pending - skip listen");
+ return 0;
+ }
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: p2p_scan running - delay start of listen state");
p2p->start_after_scan = P2P_AFTER_SCAN_LISTEN;