[PATCH 14/42] MLD: ignore failed links from association

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


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

If for some reason association fails and a link which has an error is
reported, then add that specific link to the ignore list. After that,
immediately retrigger the connection code. In the usual case, we are
then going to reconnect to the same BSS but with that particular link
not being included in the connection.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
 src/drivers/driver.h |  1 +
 wpa_supplicant/sme.c | 33 ++++++++++++++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index d7f4c599dd..d6c490d1c8 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -949,6 +949,7 @@ struct wpa_driver_mld_params {
 		const u8 *bssid;
 		const u8 *ies;
 		size_t ies_len;
+		int error;
 	} mld_links[MAX_NUM_MLD_LINKS];
 };
 
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index b4fe088149..f6f7e7fa75 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -28,6 +28,7 @@
 #include "p2p_supplicant.h"
 #include "notify.h"
 #include "bss.h"
+#include "bssid_ignore.h"
 #include "scan.h"
 #include "sme.h"
 #include "hs20_supplicant.h"
@@ -2595,11 +2596,37 @@ mscs_fail:
 	}
 
 	if (wpa_drv_associate(wpa_s, &params) < 0) {
+		u8 n_failed_links = 0;
+		int i;
+
 		wpa_msg(wpa_s, MSG_INFO, "SME: Association request to the "
 			"driver failed");
-		wpas_connection_failed(wpa_s, wpa_s->pending_bssid, NULL);
-		wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
-		os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
+
+		/* Prepare list of failed links for error report */
+		for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
+			if (!(wpa_s->valid_links & BIT(i)) ||
+			    wpa_s->mlo_assoc_link_id == i ||
+			    !params.mld_params.mld_links[i].error)
+				continue;
+
+			wpa_bssid_ignore_add(wpa_s, wpa_s->links[i].bssid);
+			n_failed_links += 1;
+		}
+
+		if (n_failed_links) {
+			/* Deauth and connect (possibly to the same BSS) */
+			wpa_drv_deauthenticate(wpa_s,
+					       wpa_s->ap_mld_addr,
+					       WLAN_REASON_DEAUTH_LEAVING);
+			wpas_connect_work_done(wpa_s);
+			wpa_supplicant_mark_disassoc(wpa_s);
+			wpas_request_connection(wpa_s);
+		} else {
+			wpas_connection_failed(wpa_s, wpa_s->pending_bssid,
+					       NULL);
+			wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
+			os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
+		}
 		return;
 	}
 
-- 
2.38.1




More information about the Hostap mailing list