From 579a80982ad07619373876c09cdd60e2afcba5b5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 8 Jun 2012 18:24:08 +0300 Subject: [PATCH] P2P: Assume GO Negotiation failed if GO Neg Conf wait times out Stop the connection attempt if GO Negotiation Confirm is not received within 100 ms of the GO Negotiation Response getting acknowledged. Previously, we would have continued trying to connect to the peer even in this case which could result in confusing second GO Negotiation Request frame and unnecessarily long wait before indicating failure. Signed-hostap: Jouni Malinen --- src/p2p/p2p.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index deccfc0f1..716454c18 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -2950,6 +2950,14 @@ int p2p_listen_end(struct p2p_data *p2p, unsigned int freq) static void p2p_timeout_connect(struct p2p_data *p2p) { p2p->cfg->send_action_done(p2p->cfg->cb_ctx); + if (p2p->go_neg_peer && + (p2p->go_neg_peer->flags & P2P_DEV_WAIT_GO_NEG_CONFIRM)) { + wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Wait for GO " + "Negotiation Confirm timed out - assume GO " + "Negotiation failed"); + p2p_go_neg_failed(p2p, p2p->go_neg_peer, -1); + return; + } p2p_set_state(p2p, P2P_CONNECT_LISTEN); p2p_listen_in_find(p2p); }