P2P: Set P2P_DEV_PEER_WAITING_RESPONSE from TX status callback

Commit fb8984fd6f added a mechanism to
skip the Listen state when the peer is expected to be waiting for us to
initiate a new GO Negotiation. However, this flag was set when building
the GO Negotiation Response frame with status 1 regardless of whether we
managed to send that frame or peer receive it. This could result in GO
Negotiation failures in cases where the peer did not receive the
response and Listen channels of the devices were different. Fix this by
setting the flag only after TX status indicating success has been
received.

This fixes frequent failures shown for the test_grpform_pbc hwsim test
case.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-04-26 12:54:27 +03:00 committed by Jouni Malinen
parent 79c3cbaf12
commit 7800d45c71
2 changed files with 9 additions and 4 deletions

View File

@ -2982,7 +2982,8 @@ static void p2p_go_neg_resp_cb(struct p2p_data *p2p, int success)
}
static void p2p_go_neg_resp_failure_cb(struct p2p_data *p2p, int success)
static void p2p_go_neg_resp_failure_cb(struct p2p_data *p2p, int success,
const u8 *addr)
{
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: GO Negotiation Response (failure) TX callback: "
@ -2990,6 +2991,12 @@ static void p2p_go_neg_resp_failure_cb(struct p2p_data *p2p, int success)
if (p2p->go_neg_peer && p2p->go_neg_peer->status != P2P_SC_SUCCESS) {
p2p_go_neg_failed(p2p, p2p->go_neg_peer,
p2p->go_neg_peer->status);
} else if (success) {
struct p2p_device *dev;
dev = p2p_get_device(p2p, addr);
if (dev &&
dev->status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE)
dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE;
}
}
@ -3069,7 +3076,7 @@ void p2p_send_action_cb(struct p2p_data *p2p, unsigned int freq, const u8 *dst,
p2p_go_neg_resp_cb(p2p, success);
break;
case P2P_PENDING_GO_NEG_RESPONSE_FAILURE:
p2p_go_neg_resp_failure_cb(p2p, success);
p2p_go_neg_resp_failure_cb(p2p, success, dst);
break;
case P2P_PENDING_GO_NEG_CONFIRM:
p2p_go_neg_conf_cb(p2p, result);

View File

@ -619,8 +619,6 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
"P2P: Not ready for GO negotiation with " MACSTR,
MAC2STR(sa));
status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE;
if (dev)
dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE;
p2p->cfg->go_neg_req_rx(p2p->cfg->cb_ctx, sa,
msg.dev_password_id);
} else if (p2p->go_neg_peer && p2p->go_neg_peer != dev) {