]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Check GO Neg Req retransmit limit in p2p_listen_end
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 12 Jan 2011 11:48:55 +0000 (13:48 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 12 Jan 2011 11:48:55 +0000 (13:48 +0200)
This needs to be done both in the more normal location in
p2p_timeout_connect_listen() (internal timeout after driver event) and
in p2p_listen_end() as a workaround for the case where the driver event
is delayed to happen after the internal timeout.

src/p2p/p2p.c

index 1589d1842e59e23dc57fed5e2895e25646ad3784..181f74c86f06cb0b93eace14718e51b60f959f8c 100644 (file)
@@ -2337,6 +2337,14 @@ int p2p_listen_end(struct p2p_data *p2p, unsigned int freq)
                return 0; /* Internal timeout will trigger the next step */
 
        if (p2p->state == P2P_CONNECT_LISTEN && p2p->go_neg_peer) {
+               if (p2p->go_neg_peer->connect_reqs >= 120) {
+                       wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
+                               "P2P: Timeout on sending GO Negotiation "
+                               "Request without getting response");
+                       p2p_go_neg_failed(p2p, p2p->go_neg_peer, -1);
+                       return 0;
+               }
+
                p2p_set_state(p2p, P2P_CONNECT);
                p2p_connect_send(p2p, p2p->go_neg_peer);
                return 1;