From: Ilan Peer <ilan.peer@xxxxxxxxx> According to section 35.3.4.2 in Draft P802.11be_D3.1, the AP MLD ID must be included in the Probe Request ML element in case it is sent to a transmitted BSS in which case it should be set to 0. If it is sent to an non-transmitted BSSID, the AP MLD ID should not be included. Signed-off-by: Ilan Peer <ilan.peer@xxxxxxxxx> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx> --- wpa_supplicant/bss.c | 7 ++++++- wpa_supplicant/bss.h | 3 ++- wpa_supplicant/events.c | 20 +++++++++++++++++--- wpa_supplicant/sme.c | 3 +-- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index 401df12fea..510eedb87f 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -1570,6 +1570,7 @@ wpa_bss_parse_ml_rnr_ap_info(struct wpa_supplicant *wpa_s, * should be initialized and #MAX_NUM_MLD_LINKS elements long * @missing_links: Result bitmask of links that were not discovered (or %NULL) * @ssid: Target SSID (or %NULL) + * @ap_mld_id: on return would hold the corresponding AP MLD ID (or %NULL) * Returns: 0 on success or -1 for non-MLD or parsing failures * * Parses the Basic Multi-Link element of the BSS into @link_info using the scan @@ -1581,7 +1582,8 @@ int wpa_bss_parse_basic_ml_element(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, u8 *ap_mld_addr, u16 *missing_links, - struct wpa_ssid *ssid) + struct wpa_ssid *ssid, + u8 *ap_mld_id) { struct ieee802_11_elems elems; struct wpabuf *mlbuf; @@ -1743,6 +1745,9 @@ int wpa_bss_parse_basic_ml_element(struct wpa_supplicant *wpa_s, if (missing_links) *missing_links = missing; + if (ap_mld_id) + *ap_mld_id = mbssid_idx; + ret = 0; out: wpabuf_free(mlbuf); diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h index bacf0a8e9c..7b13ef96b8 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h @@ -216,7 +216,8 @@ int wpa_bss_parse_basic_ml_element(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, u8 *ap_mld_addr, u16 *missing_links, - struct wpa_ssid *ssid); + struct wpa_ssid *ssid, + u8 *ap_mld_id); u16 wpa_bss_parse_reconf_ml_element(struct wpa_supplicant *wpa_s, struct wpa_bss *bss); diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index bd6630ea7e..e47445e3f7 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1135,7 +1135,7 @@ static bool wpas_valid_ml_bss(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) { u16 removed_links; - if (wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, NULL, NULL)) + if (wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, NULL, NULL, NULL)) return true; if (bss->n_mld_links == 0) @@ -1853,6 +1853,7 @@ static int wpa_supplicant_connect_ml_missing(struct wpa_supplicant *wpa_s, { int *freqs; u16 missing_links = 0, removed_links; + u8 ap_mld_id; if (!((wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO) && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME))) @@ -1860,7 +1861,8 @@ static int wpa_supplicant_connect_ml_missing(struct wpa_supplicant *wpa_s, /* Try to resolve any missing link information */ if (wpa_bss_parse_basic_ml_element(wpa_s, selected, NULL, - &missing_links, ssid) || + &missing_links, ssid, + &ap_mld_id) || !missing_links) return 0; @@ -1892,7 +1894,19 @@ static int wpa_supplicant_connect_ml_missing(struct wpa_supplicant *wpa_s, wpa_s->manual_scan_freqs = freqs; os_memcpy(wpa_s->ml_probe_bssid, selected->bssid, ETH_ALEN); - wpa_s->ml_probe_mld_id = -1; + + /* + * In case the ML probe request is intended to retrieve information from + * the transmitted BSS, then the AP MLD ID should be included and should + * be set to zero. + * In case the ML probe requested is intended to retrieve information + * from a non-transmitted BSS, the the AP MLD ID should not be included. + */ + if (ap_mld_id) + wpa_s->ml_probe_mld_id = -1; + else + wpa_s->ml_probe_mld_id = 0; + wpa_s->ml_probe_links = missing_links; wpa_s->normal_scans = 0; diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index f6f7e7fa75..4d75c0a676 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -577,10 +577,9 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s, if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO && !wpa_bss_parse_basic_ml_element(wpa_s, bss, wpa_s->ap_mld_addr, - NULL, ssid) && bss->n_mld_links) { + NULL, ssid, NULL) && bss->n_mld_links) { wpa_printf(MSG_DEBUG, "MLD: In authentication"); wpas_sme_set_mlo_links(wpa_s, bss); - #ifdef CONFIG_TESTING_OPTIONS bss = wpas_ml_connect_pref(wpa_s, bss); -- 2.38.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap