P2P: Check GO Neg Req retransmit limit in p2p_listen_end

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.
This commit is contained in:
Jouni Malinen 2011-01-12 13:48:55 +02:00 committed by Jouni Malinen
parent 8d806cc2af
commit e24cf97c0d

View 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 */ return 0; /* Internal timeout will trigger the next step */
if (p2p->state == P2P_CONNECT_LISTEN && p2p->go_neg_peer) { 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_set_state(p2p, P2P_CONNECT);
p2p_connect_send(p2p, p2p->go_neg_peer); p2p_connect_send(p2p, p2p->go_neg_peer);
return 1; return 1;