P2P: Fix provision discovery retries during p2p_find

Commit 6b56cc2d97 added retries of
provision discovery request frames in IDLE state. However, it did not
make the p2p_find case behave consistently with the new limitied retry
behavior. This can result in way too many and frequent PD retries. Fix
this by extending the previous commit to address PD retries and maximum
retry limit consistently regardless of whether p2p_find is running.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1
This commit is contained in:
Jouni Malinen 2012-07-23 21:59:01 +03:00 committed by Jouni Malinen
parent a5ed45586c
commit 488f4a7108
2 changed files with 11 additions and 5 deletions

View file

@ -2598,7 +2598,13 @@ static void p2p_prov_disc_cb(struct p2p_data *p2p, int success)
if (!success) {
p2p->pending_action_state = P2P_NO_PENDING_ACTION;
if (p2p->state != P2P_IDLE)
if (p2p->user_initiated_pd &&
(p2p->state == P2P_SEARCH || p2p->state == P2P_LISTEN_ONLY))
{
/* Retry request from timeout to avoid busy loops */
p2p->pending_action_state = P2P_PENDING_PD;
p2p_set_timeout(p2p, 0, 50000);
} else if (p2p->state != P2P_IDLE)
p2p_continue_find(p2p);
else if (p2p->user_initiated_pd) {
p2p->pending_action_state = P2P_PENDING_PD;