]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Do not re-start invitation on Probe Req RX if already ack'ed
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 4 Feb 2014 15:16:32 +0000 (17:16 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 4 Feb 2014 15:16:32 +0000 (17:16 +0200)
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>

src/p2p/p2p.c
src/p2p/p2p_i.h
src/p2p/p2p_invitation.c

index 957dee5bd9a2a44909e9c702adf2d4ab320f42ef..c103c0211188d1a5f8539105519c854d3e281714 100644 (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 */
index 6ebaa846d6ab298eb106e67656b11fa13ce8d111..f1050836c299c42b684095ba7dcca4a0f0fd4134 100644 (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 */
index 98cfb3303c021cd78496e8e3ded3aae8f426fc26..30d218cf9f46443a8ff0484e22be918bd40e8dec 100644 (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.