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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2012-06-08 18:24:08 +03:00 committed by Jouni Malinen
parent 73ccd08378
commit 579a80982a

View 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) static void p2p_timeout_connect(struct p2p_data *p2p)
{ {
p2p->cfg->send_action_done(p2p->cfg->cb_ctx); 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_set_state(p2p, P2P_CONNECT_LISTEN);
p2p_listen_in_find(p2p); p2p_listen_in_find(p2p);
} }