From: Rameshkumar Sundaram Date: Thu, 9 Oct 2025 11:18:49 +0000 (+0530) Subject: AP MLD: Handle ML probe request for non-transmitting BSS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=167aeab41b2cfc2bb73393e19ac19173a43fff8c;p=thirdparty%2Fhostap.git AP MLD: Handle ML probe request for non-transmitting BSS Currently, when a non-transmitting BSS in an MBSSID AP MLD receives a Probe Request frame with AP MLD ID set, the Probe Response frame is sent only with Basic MLE for the transmitting BSS. Update Basic MLE of non-TX BSS if Probe Request frame is received with AP MLD ID set, along with full STA profile info of the solicited AP MLD, carried in the Probe Response frame body. If TX BSS is also affiliated with an AP MLD, add the Basic MLE of the TX BSS without any STA profile info. With this, a non-AP MLD sending ML Probe Request frame targeting a non-TX BSS in an AP MLD, can correctly identify the AP MLD with which the AP corressponding to the non-TX BSS is affiliated based on the AP MLD ID subfield. Signed-off-by: Rameshkumar Sundaram Signed-off-by: Manish Dharanenthiran --- diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 52e1f714e..ad2af6e7a 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -738,7 +738,8 @@ 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; + struct hostapd_data *hapd_probed = params->mld_ap ? params->mld_ap : + hapd; size_t buflen = 0; hapd = hostapd_mbssid_get_tx_bss(hapd); @@ -770,27 +771,32 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) { - struct hostapd_data *ml_elem_ap = - params->mld_ap ? params->mld_ap : hapd; buflen += hostapd_eid_eht_capab_len(hapd, IEEE80211_MODE_AP); buflen += 3 + sizeof(struct ieee80211_eht_operation); if (hapd->iconf->punct_bitmap) buflen += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE; - if (ml_elem_ap->conf->mld_ap) { + if (params->mld_ap && params->mld_ap->conf->mld_ap) { buflen += hostapd_eid_eht_ml_beacon_len( - ml_elem_ap, params->mld_info, !!params->mld_ap); + params->mld_ap, params->mld_info, + !!params->mld_ap); + + if (hapd->conf->mld_ap) + buflen += hostapd_eid_eht_ml_beacon_len( + hapd, NULL, false); /* For Max Channel Switch Time element during channel * switch */ buflen += 6; - } + } else if (hapd->conf->mld_ap) { + buflen += hostapd_eid_eht_ml_beacon_len( + hapd, params->mld_info, false); - if (hapd_probed != hapd && hapd_probed->conf->mld_ap) - buflen += hostapd_eid_eht_basic_ml_len(hapd_probed, - NULL, true, - false); + /* For Max Channel Switch Time element during channel + * switch */ + buflen += 6; + } } #endif /* CONFIG_IEEE80211BE */ @@ -814,7 +820,8 @@ 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; + struct hostapd_data *hapd_probed = params->mld_ap ? params->mld_ap : + hapd; u8 *csa_pos; u8 *epos; @@ -942,21 +949,24 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) { - struct hostapd_data *ml_elem_ap = - params->mld_ap ? params->mld_ap : hapd; - - if (ml_elem_ap->conf->mld_ap) + if (params->mld_ap && params->mld_ap->conf->mld_ap) { pos = hostapd_eid_eht_ml_beacon( - ml_elem_ap, params->mld_info, + params->mld_ap, params->mld_info, pos, !!params->mld_ap); + if (hapd->conf->mld_ap) + pos = hostapd_eid_eht_ml_beacon( + hapd, NULL, pos, false); + + } else if (hapd->conf->mld_ap) { + pos = hostapd_eid_eht_ml_beacon(hapd, + params->mld_info, + pos, false); + } + 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, false); #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_IEEE80211AC