diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 957dee5bd..c103c0211 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -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 */ diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index 6ebaa846d..f1050836c 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -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 */ diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c index 98cfb3303..30d218cf9 100644 --- a/src/p2p/p2p_invitation.c +++ b/src/p2p/p2p_invitation.c @@ -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.