P2P: Do not indicate P2P_FIND failure if p2p_scan is in progress

It was possible to FAIL return for a P2P_FIND command that was issued
while an already started P2P_FIND operation was in the scan phase. This
can be confusing for upper layer software, so hide the failure report
from the ctrl_iface response. The previously started scan will continue
the find operation after this.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2014-02-10 14:36:39 +02:00 committed by Jouni Malinen
parent 8c18fcc237
commit 825fb6b20b

View file

@ -1049,6 +1049,7 @@ int p2p_find(struct p2p_data *p2p, unsigned int timeout,
} else if (p2p->p2p_scan_running) { } else if (p2p->p2p_scan_running) {
p2p_dbg(p2p, "Failed to start p2p_scan - another p2p_scan was already running"); p2p_dbg(p2p, "Failed to start p2p_scan - another p2p_scan was already running");
/* wait for the previous p2p_scan to complete */ /* wait for the previous p2p_scan to complete */
res = 0; /* do not report failure */
} else { } else {
p2p_dbg(p2p, "Failed to start p2p_scan"); p2p_dbg(p2p, "Failed to start p2p_scan");
p2p_set_state(p2p, P2P_IDLE); p2p_set_state(p2p, P2P_IDLE);