P2P: Do not change P2P state on GO Neg failure if it is P2P_SEARCH

Changing the P2P state to P2P_IDLE on GO Negotiation Failure would stop
the previously issued P2P_FIND operation without notifying the upper
layers. Leave the search operation running if in P2P_SEARCH state to
avoid unexpected behavior in case the upper layers issued a new P2P_FIND
while waiting for GO Negotiation to complete.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Rashmi Ramanna 2014-11-17 16:07:24 +05:30 committed by Jouni Malinen
parent 47261405d7
commit 9d11832090

View file

@ -219,9 +219,15 @@ void p2p_go_neg_failed(struct p2p_data *p2p, int status)
if (!peer) if (!peer)
return; return;
p2p_clear_timeout(p2p);
eloop_cancel_timeout(p2p_go_neg_wait_timeout, p2p, NULL); eloop_cancel_timeout(p2p_go_neg_wait_timeout, p2p, NULL);
if (p2p->state != P2P_SEARCH) {
/*
* Clear timeouts related to GO Negotiation if no new p2p_find
* has been started.
*/
p2p_clear_timeout(p2p);
p2p_set_state(p2p, P2P_IDLE); p2p_set_state(p2p, P2P_IDLE);
}
peer->flags &= ~P2P_DEV_PEER_WAITING_RESPONSE; peer->flags &= ~P2P_DEV_PEER_WAITING_RESPONSE;
peer->wps_method = WPS_NOT_READY; peer->wps_method = WPS_NOT_READY;