]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Set timeout when starting GO Negotiation from Probe Req RX
authorJouni Malinen <j@w1.fi>
Sat, 27 Sep 2014 10:44:03 +0000 (13:44 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 27 Sep 2014 13:12:41 +0000 (16:12 +0300)
It was possible for the p2p_go_neg_start timeout handler to get called
when there was a pending timeout from an earlier GO Negotiation start.
This could result in that old timeout expiring too early for the newly
started GO Negotiation to complete. Avoid such issues by setting a
sufficiently long timeout here just before triggering the new GO
Negotiation.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/p2p/p2p.c

index c4676ed382c12c680f48db03ddc9139b752883c2..55b0410a18849a651fd3d6eab394838ea5ca55bb 100644 (file)
@@ -1831,6 +1831,11 @@ static void p2p_go_neg_start(void *eloop_ctx, void *timeout_ctx)
        }
        p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
        p2p->go_neg_peer->status = P2P_SC_SUCCESS;
+       /*
+        * Set new timeout to make sure a previously set one does not expire
+        * too quickly while waiting for the GO Negotiation to complete.
+        */
+       p2p_set_timeout(p2p, 0, 500000);
        p2p_connect_send(p2p, p2p->go_neg_peer);
 }