]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Make invitation flow less aggressive
authorAyala Beker <ayala.beker@intel.com>
Mon, 19 Dec 2022 12:52:38 +0000 (14:52 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 21 Feb 2023 09:19:15 +0000 (11:19 +0200)
Currently invitation request wait time is very long and not needed for
sending a single Action frame only. To not interfere with other parallel
channel activities, decrease the wait time to to 150 ms in case of an
active P2P GO on the system.

In addition, if a P2P GO tries to invite a client that doesn't respond,
it will attempt to invite again after 100 ms. This is too aggressive and
may result in missing beacon transmission and affecting GO activity on
its operating channel. Increase the timeout to 120 ms, to allow enough
time for beacon transmission.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/p2p/p2p.c
src/p2p/p2p_invitation.c

index a5a11a883649c924baca7c88037305e993bfd7f6..39af1b9bb0e92bc3e6ea908fc2dbf861e95df9ed 100644 (file)
@@ -4105,9 +4105,11 @@ static void p2p_timeout_invite(struct p2p_data *p2p)
                /*
                 * Better remain on operating channel instead of listen channel
                 * when running a group.
+                * Wait 120 ms to let the P2P GO to send its beacon on the
+                * intended TBTT.
                 */
                p2p_dbg(p2p, "Inviting in active GO role - wait on operating channel");
-               p2p_set_timeout(p2p, 0, 100000);
+               p2p_set_timeout(p2p, 0, 120000);
                return;
        }
        p2p_listen_in_find(p2p, 0);
index bca5b90963608abc9f8ee1c3bc8306455902e1de..941ec004bff82189d3e824a35afdc88b7bb92cb1 100644 (file)
@@ -598,9 +598,14 @@ int p2p_invite_send(struct p2p_data *p2p, struct p2p_device *dev,
        p2p->pending_action_state = P2P_PENDING_INVITATION_REQUEST;
        p2p->invite_peer = dev;
        dev->invitation_reqs++;
+
+       /* In case of an active P2P GO use a shorter wait time to avoid
+        * issues if not sending out multiple consecutive Beacon frames. */
        if (p2p_send_action(p2p, freq, dev->info.p2p_device_addr,
                            p2p->cfg->dev_addr, dev->info.p2p_device_addr,
-                           wpabuf_head(req), wpabuf_len(req), 500) < 0) {
+                           wpabuf_head(req), wpabuf_len(req),
+                           p2p->inv_role == P2P_INVITE_ROLE_ACTIVE_GO ?
+                           150 : 500) < 0) {
                p2p_dbg(p2p, "Failed to send Action frame");
                /* Use P2P find to recover and retry */
                p2p_set_timeout(p2p, 0, 0);