From 825fb6b20bcc58d9a7445e23bde4f6c69bfd1bdc Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 10 Feb 2014 14:36:39 +0200 Subject: [PATCH] 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 --- src/p2p/p2p.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index c103c0211..3010377e5 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -1049,6 +1049,7 @@ int p2p_find(struct p2p_data *p2p, unsigned int timeout, } else if (p2p->p2p_scan_running) { p2p_dbg(p2p, "Failed to start p2p_scan - another p2p_scan was already running"); /* wait for the previous p2p_scan to complete */ + res = 0; /* do not report failure */ } else { p2p_dbg(p2p, "Failed to start p2p_scan"); p2p_set_state(p2p, P2P_IDLE);