[PATCH 12/42] MLD: Return status code for links when rejecting association

Andrei Otcheretianski andrei.otcheretianski at intel.com
Mon Nov 20 15:51:26 PST 2023


From: Benjamin Berg <benjamin.berg at intel.com>

When the TX link rejects the association, return a status code for all
requested links. For simplicity, just return "TX link not accepted" so
that clients may try to connect to other links. This could be improved
to explicitly reject each link if directly associating to the link
will not work either.

Also add a TEST_FAIL to fail one link in an MLD association.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/ap/ieee802_11.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 7de12284d9..85b02947a8 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -4500,7 +4500,7 @@ bool hostapd_is_mld_ap(struct hostapd_data *hapd)
 static void hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
 					  struct sta_info *sta,
 					  const u8 *ies, size_t ies_len,
-					  bool reassoc)
+					  bool reassoc, int tx_link_status)
 {
 #ifdef CONFIG_IEEE80211BE
 	unsigned int i, j;
@@ -4536,7 +4536,8 @@ static void hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
 				break;
 		}
 
-		if (!iface || j == hapd->iface->interfaces->count) {
+		if (!iface || j == hapd->iface->interfaces->count ||
+		    TEST_FAIL()) {
 			wpa_printf(MSG_DEBUG,
 				   "MLD: No link match for link_id=%u", i);
 
@@ -4546,6 +4547,14 @@ static void hostapd_process_assoc_ml_info(struct hostapd_data *hapd,
 					hapd, link->status,
 					link->resp_sta_profile,
 					sizeof(link->resp_sta_profile));
+		} else if (tx_link_status != WLAN_STATUS_SUCCESS) {
+			/* TX link rejected the connection */
+			link->status = WLAN_STATUS_DENIED_TX_LINK_NOT_ACCEPTED;
+			link->resp_sta_profile_len =
+				ieee80211_ml_build_assoc_resp(hapd,
+							      link->status,
+							      link->resp_sta_profile,
+							      sizeof(link->resp_sta_profile));
 		} else {
 			ieee80211_ml_process_link(iface->bss[0], sta, link,
 						  ies, ies_len, reassoc);
@@ -5500,8 +5509,7 @@ static void handle_assoc(struct hostapd_data *hapd,
 	 *    issues with processing other non-Data Class 3 frames during this
 	 *    window.
 	 */
-	if (resp == WLAN_STATUS_SUCCESS)
-		hostapd_process_assoc_ml_info(hapd, sta, pos, left, reassoc);
+	hostapd_process_assoc_ml_info(hapd, sta, pos, left, reassoc, resp);
 
 	if (resp == WLAN_STATUS_SUCCESS && sta &&
 	    add_associated_sta(hapd, sta, reassoc))
-- 
2.38.1




More information about the Hostap mailing list