]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBSSID: Add Extended Supported Rates element in MBSSID profile
authorRameshkumar Sundaram <quic_ramess@quicinc.com>
Tue, 11 Feb 2025 17:27:08 +0000 (22:57 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 11 Feb 2025 20:38:26 +0000 (22:38 +0200)
The length for Extended Supported Rates element was allocated, but the
element was never filled in the profile. Add logic to fill it now.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/ap/ieee802_11.c

index 2d90e24066c35e274caccd1d46245b5619d95a8f..5db8e24e41f48e24914052f4e705d54575435e1f 100644 (file)
@@ -8401,13 +8401,16 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end,
                                    const u8 *known_bss, size_t known_bss_len)
 {
        struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd);
-       size_t i;
+       size_t i, tx_xrate_len;
        u8 *eid_len_offset, *max_bssid_indicator_offset;
+       u8 buf[100];
 
        *eid++ = WLAN_EID_MULTIPLE_BSSID;
        eid_len_offset = eid++;
        max_bssid_indicator_offset = eid++;
 
+       tx_xrate_len = hostapd_eid_ext_supp_rates(tx_bss, buf) - buf;
+
        for (i = *bss_index; i < hapd->iface->num_bss; i++) {
                struct hostapd_data *bss = hapd->iface->bss[i];
                struct hostapd_bss_config *conf;
@@ -8415,7 +8418,7 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end,
                u8 *eid_len_pos, *nontx_bss_start = eid;
                const u8 *auth, *rsn = NULL, *rsnx = NULL;
                u8 ie_count = 0, non_inherit_ie[3];
-               size_t auth_len = 0;
+               size_t auth_len = 0, xrate_len;
                u16 capab_info;
                u8 mbssindex = i;
 
@@ -8480,12 +8483,13 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end,
                }
 
                eid += hostapd_mbssid_ext_capa(bss, tx_bss, eid);
+               xrate_len = hostapd_eid_ext_supp_rates(bss, eid) - eid;
+               eid += xrate_len;
 
                /* List of Element ID values in increasing order */
                if (!rsn && hostapd_wpa_ie(tx_bss, WLAN_EID_RSN))
                        non_inherit_ie[ie_count++] = WLAN_EID_RSN;
-               if (hapd->conf->xrates_supported &&
-                   !bss->conf->xrates_supported)
+               if (tx_xrate_len && !xrate_len)
                        non_inherit_ie[ie_count++] = WLAN_EID_EXT_SUPP_RATES;
                if (!rsnx && hostapd_wpa_ie(tx_bss, WLAN_EID_RSNX))
                        non_inherit_ie[ie_count++] = WLAN_EID_RSNX;