From: Jouni Malinen Date: Sat, 27 Sep 2014 10:44:03 +0000 (+0300) Subject: P2P: Set timeout when starting GO Negotiation from Probe Req RX X-Git-Tag: hostap_2_3~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e49cabcf875f50cad00ba6555d971434458c364b;p=thirdparty%2Fhostap.git 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 --- 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); }