]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: Defer the start request until the discovery response RX for MLO
authorKiran Kumar Lokere <quic_klokere@quicinc.com>
Tue, 6 Feb 2024 23:57:53 +0000 (15:57 -0800)
committerJouni Malinen <j@w1.fi>
Sun, 18 Feb 2024 09:24:29 +0000 (11:24 +0200)
When the station (non-AP MLD) is associated with an AP MLD the link ID
for TDLS setup is derived from the discovery response frame and the link
ID is used in TDLS setup operation when acting as initiator. The driver
sends the received discovery response frame followed by the TDLS setup
request event. But the discovery response frame is received after the
setup request event leading to use incorrect link ID value for TDLS
setup operation causing the setup failure. Process the TDLS setup
request if the discovery response frame is received, else defer the
process until the discovery response frame is received and process the
setup request after discovery response frame is processed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/rsn_supp/tdls.c

index 8a7509170599d669ae41afa29c82b1a42d1c41e8..72ac9d9471d795427b4098409b5d8cbffd09bd67 100644 (file)
@@ -161,6 +161,8 @@ struct wpa_tdls_peer {
        int chan_switch_enabled;
 
        int mld_link_id;
+       bool disc_resp_rcvd;
+       bool setup_req_rcvd;
 };
 
 
@@ -2868,6 +2870,12 @@ int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr)
                return 0;
        }
 
+       if (sm->mlo.valid_links && !peer->disc_resp_rcvd) {
+               wpa_printf(MSG_DEBUG,
+                          "TDLS: MLO STA connection - defer the setup request since Discovery Resp not yet received");
+               peer->setup_req_rcvd = true;
+               return 0;
+       }
        peer->initiator = 1;
 
        /* add the peer to the driver as a "setup in progress" peer */
@@ -3236,6 +3244,13 @@ int wpa_tdls_process_discovery_response(struct wpa_sm *sm, const u8 *addr,
        wpa_printf(MSG_DEBUG, "TDLS: Link identifier BSS: " MACSTR
                   " , link id: %u", MAC2STR(lnkid->bssid), link_id);
 
+       peer->disc_resp_rcvd = true;
+       if (peer->setup_req_rcvd) {
+               peer->setup_req_rcvd = false;
+               wpa_printf(MSG_DEBUG, "TDLS: Process the deferred TDLS start");
+               return wpa_tdls_start(sm, addr);
+       }
+
        return 0;
 }