From 7aec2a4b6c88d0ee4eae0d62ff4d4157ee09ed64 Mon Sep 17 00:00:00 2001 From: Dhanavandhana Kannan Date: Thu, 21 Dec 2023 12:43:49 +0530 Subject: [PATCH] hostapd: Set MLD_ID to false in bcn and non-ml prb resp frame Currently AP MLD ID subfield is set to true in Basic Multi-Link element in beacon frame. The AP MLD ID subfield is not present in the Basic Multi-Link element when the element is carried in a Beacon frame, (Re)Association Response frame, Authentication frame, or Probe Response frame that is not a multi-link probe response. Hence set the value of MLD ID to be false when carried in a beacon frame. As per spec ieee80211be Draft 4.0, MLD ID is required for ML probe response and it is not required for Non-ML probe response frames, hence removing the MLD ID IE from Non-ML probe response frames. Signed-off-by: Dhanavandhana Kannan --- src/ap/beacon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -982,9 +982,12 @@ static u8 * hostapd_gen_probe_resp(struc if (is_5ghz_freq(hapd->iface->freq)) buflen += (6 + 2 + 4 + sizeof(struct ieee80211_240mhz_vendor_oper)); + + if (hapd_probed != hapd && hapd_probed->conf->mld_ap && ml_probe) + buflen += hostapd_eid_eht_basic_ml_len(hapd_probed, + NULL, true); } - if (hapd_probed != hapd && hapd_probed->conf->mld_ap) - buflen += hostapd_eid_eht_basic_ml_len(hapd_probed, NULL, true); + #endif /* CONFIG_IEEE80211BE */ buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL, @@ -1156,18 +1159,21 @@ static u8 * hostapd_gen_probe_resp(struc #ifdef CONFIG_IEEE80211BE if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) { if (hapd->conf->mld_ap) { - if (ml_probe) + if (hapd_probed == hapd && ml_probe) pos = hostapd_eid_eht_basic_ml(hapd, pos, - hapd->partner_links, true); + hapd->partner_links, false); else - pos = hostapd_eid_eht_basic_ml(hapd, pos, NULL, true); + pos = hostapd_eid_eht_basic_ml(hapd, pos, NULL, false); } pos = hostapd_eid_eht_capab(hapd, pos, IEEE80211_MODE_AP); pos = hostapd_eid_eht_operation(hapd, pos, IEEE80211_MODE_AP); pos = hostapd_eid_vendor_240mhz(hapd, pos, IEEE80211_MODE_AP); + + if (hapd_probed != hapd && hapd_probed->conf->mld_ap && ml_probe) + pos = hostapd_eid_eht_basic_ml(hapd_probed, pos, + NULL, true); } - if (hapd_probed != hapd && hapd_probed->conf->mld_ap) - pos = hostapd_eid_eht_basic_ml(hapd_probed, pos, NULL, true); + #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_IEEE80211AC @@ -2436,7 +2442,7 @@ int ieee802_11_build_ap_params(struct ho if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) { if (hapd->conf->mld_ap) tailpos = hostapd_eid_eht_basic_ml(hapd, tailpos, NULL, - true); + false); tailpos = hostapd_eid_eht_capab(hapd, tailpos, IEEE80211_MODE_AP); startpos = tailpos;