]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBSSID: Use probed hostapd context during probe response generation
authorRameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Wed, 8 Oct 2025 03:20:47 +0000 (08:50 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 8 Oct 2025 21:06:15 +0000 (00:06 +0300)
While filling MBSSID elements during Probe Response frame generation,
the TX BSS context is passed to hostapd_eid_mbssid() and
hostapd_eid_mbssid_len(), but for a Probe Request frame directed to a
non-TX BSS, these functions need probed hostapd context as well.

Hence, make changes to pass the probed hostapd context while generating
Probe Response frames.

Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Signed-off-by: Karthik M <karthik.m@oss.qualcomm.com>
Signed-off-by: Manish Dharanenthiran <manish.dharanenthiran@oss.qualcomm.com>
src/ap/beacon.c
src/ap/ieee802_11.c

index 259582357a1eea8e019fedcb04bbffa9d8c87f9d..0f35e60349a2fca8f232c3b56ad4f08c60d8a869 100644 (file)
@@ -738,9 +738,7 @@ 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)
 {
-#ifdef CONFIG_IEEE80211BE
        struct hostapd_data *hapd_probed = hapd;
-#endif /* CONFIG_IEEE80211BE */
        size_t buflen = 0;
 
        hapd = hostapd_mbssid_get_tx_bss(hapd);
@@ -796,7 +794,8 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd,
        }
 #endif /* CONFIG_IEEE80211BE */
 
-       buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL,
+       buflen += hostapd_eid_mbssid_len(hapd_probed, WLAN_FC_STYPE_PROBE_RESP,
+                                        NULL,
                                         params->known_bss,
                                         params->known_bss_len, NULL);
        buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP, true);
@@ -815,9 +814,7 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
                                          struct probe_resp_params *params,
                                          u8 *pos, size_t len)
 {
-#ifdef CONFIG_IEEE80211BE
        struct hostapd_data *hapd_probed = hapd;
-#endif /* CONFIG_IEEE80211BE */
        u8 *csa_pos;
        u8 *epos;
 
@@ -857,7 +854,8 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd,
 
        pos = hostapd_get_rsne(hapd, pos, epos - pos);
        pos = hostapd_eid_bss_load(hapd, pos, epos - pos);
-       pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0,
+       pos = hostapd_eid_mbssid(hapd_probed, pos, epos,
+                                WLAN_FC_STYPE_PROBE_RESP, 0,
                                 NULL, params->known_bss, params->known_bss_len,
                                 NULL, NULL, NULL, 0);
        pos = hostapd_eid_rm_enabled_capab(hapd, pos, epos - pos);
index 52547bfc02430480a11bd110fc17da3f345ce2ae..75c085383ed1a84e81daf5d75e465bc56a325534 100644 (file)
@@ -8690,10 +8690,11 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd,
 }
 
 
-size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type,
+size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd_probed, u32 frame_type,
                              u8 *elem_count, const u8 *known_bss,
                              size_t known_bss_len, size_t *rnr_len)
 {
+       struct hostapd_data *hapd = hostapd_mbssid_get_tx_bss(hapd_probed);
        size_t len = 0, bss_index = 1;
 
        if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 ||
@@ -8713,7 +8714,7 @@ size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type,
        while (bss_index < hapd->iface->num_bss) {
                size_t rnr_count = bss_index;
 
-               len += hostapd_eid_mbssid_elem_len(hapd, frame_type,
+               len += hostapd_eid_mbssid_elem_len(hapd_probed, frame_type,
                                                   &bss_index, known_bss,
                                                   known_bss_len);
 
@@ -8875,12 +8876,13 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end,
 }
 
 
-u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
+u8 * hostapd_eid_mbssid(struct hostapd_data *hapd_probed, u8 *eid, u8 *end,
                        unsigned int frame_stype, u8 elem_count,
                        u8 **elem_offset,
                        const u8 *known_bss, size_t known_bss_len, u8 *rnr_eid,
                        u8 *rnr_count, u8 **rnr_offset, size_t rnr_len)
 {
+       struct hostapd_data *hapd = hostapd_mbssid_get_tx_bss(hapd_probed);
        size_t bss_index = 1, cur_len = 0;
        u8 elem_index = 0, *rnr_start_eid = rnr_eid;
        bool add_rnr;
@@ -8913,7 +8915,8 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end,
                        elem_offset[elem_index] = eid;
                        elem_index = elem_index + 1;
                }
-               eid = hostapd_eid_mbssid_elem(hapd, eid, end, frame_stype,
+               eid = hostapd_eid_mbssid_elem(hapd_probed, eid, end,
+                                             frame_stype,
                                              hostapd_max_bssid_indicator(hapd),
                                              &bss_index, elem_count,
                                              known_bss, known_bss_len);