diff mbox series

p2p: continue listening next request if no post-PD operations

Message ID CALoVRkPytBH-Sy1O7sbkFmwg_rtKCTg7_D2bUV0Bfp6ihmtczQ@mail.gmail.com
State Accepted
Headers show
Series p2p: continue listening next request if no post-PD operations | expand

Commit Message

Jimmy Chen Oct. 17, 2019, 1:36 p.m. UTC
If no post-provision discovery operations, it should continue listening
next request or this results in the p2p_find operation getting stopped
(stuck in SEARCH state) unexpectedly.

Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
---
 src/p2p/p2p.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

  "Post-Provision Discovery operations started - do not try to
continue other P2P operations");

Comments

Jouni Malinen Oct. 25, 2019, 4:54 p.m. UTC | #1
On Thu, Oct 17, 2019 at 09:36:50PM +0800, Jimmy Chen wrote:
> If no post-provision discovery operations, it should continue listening
> next request or this results in the p2p_find operation getting stopped
> (stuck in SEARCH state) unexpectedly.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index a08ba0268..24e429c59 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -3451,12 +3451,18 @@  static void p2p_prov_disc_resp_cb(struct
p2p_data *p2p, int success)

  p2p->pending_action_state = P2P_NO_PENDING_ACTION;

- if (!success)
+ if (!success) {
+ if (p2p->state == P2P_SEARCH)
+ p2p_continue_find(p2p);
  return;
+ }

  if (!p2p->cfg->prov_disc_resp_cb ||
-     p2p->cfg->prov_disc_resp_cb(p2p->cfg->cb_ctx) < 1)
+     p2p->cfg->prov_disc_resp_cb(p2p->cfg->cb_ctx) < 1) {
+ if (p2p->state == P2P_SEARCH)
+ p2p_continue_find(p2p);
  return;
+ }

  p2p_dbg(p2p,