]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear the discovery state incase of deffered GO Neg response android-l
authorJithu Jance <jithu@broadcom.com>
Tue, 19 Aug 2014 21:19:38 +0000 (14:19 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 6 Oct 2015 20:11:45 +0000 (23:11 +0300)
Bug: 17027752

Change-Id: I7d16080864264b838169f7b477598353c5d61d37
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
src/p2p/p2p.c

index 767706c01d6b318de1977fa0cf98f302997565cd..5d6abe3014bfe490fcd9ccae3093ded25cce15ea 100644 (file)
@@ -3572,8 +3572,17 @@ static void p2p_go_neg_resp_failure_cb(struct p2p_data *p2p, int success,
                struct p2p_device *dev;
                dev = p2p_get_device(p2p, addr);
                if (dev &&
-                   dev->status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE)
+                   dev->status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE) {
                        dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE;
+                       if ((p2p->state == P2P_SEARCH) ||
+                           (p2p->state == P2P_LISTEN_ONLY)) {
+                               /* Clear our search state or Listen state since
+                                * now peer is awaiting response from our side.
+                                */
+                               p2p_dbg(p2p, "Clear the P2P discovery state");
+                               p2p_stop_find(p2p);
+                       }
+               }
        }
 
        if (p2p->state == P2P_SEARCH || p2p->state == P2P_SD_DURING_FIND)