From e49cabcf875f50cad00ba6555d971434458c364b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 27 Sep 2014 13:44:03 +0300 Subject: [PATCH] P2P: Set timeout when starting GO Negotiation from Probe Req RX 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 --- src/p2p/p2p.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index c4676ed38..55b0410a1 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -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); }