]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBSSID: Handle Probe Response frame formation with MLO MBSSID
authorRameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Mon, 5 May 2025 17:37:08 +0000 (10:37 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 6 May 2025 12:59:51 +0000 (15:59 +0300)
If the solicited AP is part of an MLD, add MLE for it in the frame body
of multi-link probe response.

Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Signed-off-by: Muna Sinada <muna.sinada@oss.qualcomm.com>
Signed-off-by: Aloka Dixit <aloka.dixit@oss.qualcomm.com>
src/ap/beacon.c

index c172116773fec9df84914dad5720fc424822c747..de5ebcf0e172244a321650ff5c4c192e9824acc0 100644 (file)
@@ -738,8 +738,11 @@ static void hostapd_free_probe_resp_params(struct probe_resp_params *params)
 static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
                                           struct probe_resp_params *params)
 {
+       struct hostapd_data *hapd_probed = hapd;
        size_t buflen = 0;
 
+       hapd = hostapd_mbssid_get_tx_bss(hapd);
+
 #ifdef CONFIG_WPS
        if (hapd->wps_probe_resp_ie)
                buflen += wpabuf_len(hapd->wps_probe_resp_ie);
@@ -783,6 +786,10 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
                         * switch */
                        buflen += 6;
                }
+
+               if (hapd_probed != hapd && hapd_probed->conf->mld_ap)
+                       buflen += hostapd_eid_eht_basic_ml_len(hapd_probed,
+                                                              NULL, true);
        }
 #endif /* CONFIG_IEEE80211BE */
 
@@ -805,9 +812,11 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
                                          struct probe_resp_params *params,
                                          u8 *pos, size_t len)
 {
+       struct hostapd_data *hapd_probed = hapd;
        u8 *csa_pos;
        u8 *epos;
 
+       hapd = hostapd_mbssid_get_tx_bss(hapd);
        epos = pos + len;
 
        *pos++ = WLAN_EID_SSID;
@@ -941,6 +950,10 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
                pos = hostapd_eid_eht_capab(hapd, pos, IEEE80211_MODE_AP);
                pos = hostapd_eid_eht_operation(hapd, pos);
        }
+
+       if (hapd_probed != hapd && hapd_probed->conf->mld_ap)
+               pos = hostapd_eid_eht_basic_ml_common(hapd_probed, pos, NULL,
+                                                     true);
 #endif /* CONFIG_IEEE80211BE */
 
 #ifdef CONFIG_IEEE80211AC
@@ -1009,6 +1022,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
 static void hostapd_gen_probe_resp(struct hostapd_data *hapd,
                                   struct probe_resp_params *params)
 {
+       struct hostapd_data *hapd_probed = hapd;
        u8 *pos;
        size_t buflen;
 
@@ -1016,7 +1030,7 @@ static void hostapd_gen_probe_resp(struct hostapd_data *hapd,
 
 #define MAX_PROBERESP_LEN 768
        buflen = MAX_PROBERESP_LEN;
-       buflen += hostapd_probe_resp_elems_len(hapd, params);
+       buflen += hostapd_probe_resp_elems_len(hapd_probed, params);
        params->resp = os_zalloc(buflen);
        if (!params->resp) {
                params->resp_len = 0;
@@ -1046,7 +1060,7 @@ static void hostapd_gen_probe_resp(struct hostapd_data *hapd,
        params->resp->u.probe_resp.capab_info =
                host_to_le16(hostapd_own_capab_info(hapd));
 
-       pos = hostapd_probe_resp_fill_elems(hapd, params,
+       pos = hostapd_probe_resp_fill_elems(hapd_probed, params,
                                            params->resp->u.probe_resp.variable,
                                            buflen);