P2P: Do not re-start invitation on Probe Req RX if already ack'ed

If the peer device has already acknowledge receipt of the Invitation
Request frame, it is better not to re-start invitation by sending
another Invitation Request. This should not be needed since the peer
already has received the Invitation Request frame and sending the second
round in this type of sequence can cause issues with nl80211 offloaded
offchannel TX operations since driver_nl80211.c will lose the cookie
value for the first pending Action frame and may not be able to cancel
offchannel wait for it properly. this has been seen to trigger a failure
in the p2p_go_invite_auth test case with the scan failing due to GO
sending out Probe Response frame on incorrect channel (the channel used
in that not-cancelled Action TX).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2014-02-04 17:16:32 +02:00 committed by Jouni Malinen
parent e8a1572532
commit a05e236b11
3 changed files with 7 additions and 0 deletions

View file

@ -2125,6 +2125,7 @@ p2p_probe_req_rx(struct p2p_data *p2p, const u8 *addr, const u8 *dst,
if ((p2p->state == P2P_INVITE || p2p->state == P2P_INVITE_LISTEN) &&
p2p->invite_peer &&
(p2p->invite_peer->flags & P2P_DEV_WAIT_INV_REQ_ACK) &&
os_memcmp(addr, p2p->invite_peer->info.p2p_device_addr, ETH_ALEN)
== 0) {
/* Received a Probe Request from Invite peer */

View file

@ -97,6 +97,7 @@ struct p2p_device {
#define P2P_DEV_PREFER_PERSISTENT_RECONN BIT(16)
#define P2P_DEV_PD_BEFORE_GO_NEG BIT(17)
#define P2P_DEV_NO_PREF_CHAN BIT(18)
#define P2P_DEV_WAIT_INV_REQ_ACK BIT(19)
unsigned int flags;
int status; /* enum p2p_status_code */

View file

@ -488,6 +488,8 @@ int p2p_invite_send(struct p2p_data *p2p, struct p2p_device *dev,
p2p_dbg(p2p, "Failed to send Action frame");
/* Use P2P find to recover and retry */
p2p_set_timeout(p2p, 0, 0);
} else {
dev->flags |= P2P_DEV_WAIT_INV_REQ_ACK;
}
wpabuf_free(req);
@ -505,6 +507,9 @@ void p2p_invitation_req_cb(struct p2p_data *p2p, int success)
return;
}
if (success)
p2p->invite_peer->flags &= ~P2P_DEV_WAIT_INV_REQ_ACK;
/*
* Use P2P find, if needed, to find the other device from its listen
* channel.