]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Assume GO Negotiation failed if GO Neg Conf wait times out
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 8 Jun 2012 15:24:08 +0000 (18:24 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 8 Jun 2012 15:24:08 +0000 (18:24 +0300)
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 <jouni@qca.qualcomm.com>

src/p2p/p2p.c

index deccfc0f1dd32c3af8013fc7ea7665d038c899e3..716454c187f262b117ef7b444132594737054513 100644 (file)
@@ -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);
 }