]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Don't expire the peer, if GO Negotiation is in progress
authorJithu Jance <jithu@broadcom.com>
Wed, 15 Jan 2014 10:22:51 +0000 (15:52 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 17 Jan 2014 09:53:33 +0000 (11:53 +0200)
This adds one more case of active P2P peer detection so that
p2p_expire_peers() cannot hit a case where a GO Negotiation peer would
be removed.

Signed-hostap: Jithu Jance <jithu@broadcom.com>

src/p2p/p2p.c

index 083a156b76dac89fa24fd2868ec04888f071b711..138ba16bdb008fec57790da552b06062edf6282b 100644 (file)
@@ -56,6 +56,15 @@ static void p2p_expire_peers(struct p2p_data *p2p)
                if (dev->last_seen.sec + P2P_PEER_EXPIRATION_AGE >= now.sec)
                        continue;
 
+               if (dev == p2p->go_neg_peer) {
+                       /*
+                        * GO Negotiation is in progress with the peer, so
+                        * don't expire the peer entry until GO Negotiation
+                        * fails or times out.
+                        */
+                       continue;
+               }
+
                if (p2p->cfg->go_connected &&
                    p2p->cfg->go_connected(p2p->cfg->cb_ctx,
                                           dev->info.p2p_device_addr)) {