diff mbox series

[2/7] wpa_supplicant: Do not roam to an associated link

Message ID 20240408130701.531194-2-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series [1/7] tests: Wait after removing a BSS | expand

Commit Message

Andrei Otcheretianski April 8, 2024, 1:06 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

When considering to roam to a different BSS and the connection
is an MLD connection, do not roam to a BSS which is already
included in the MLD connection.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 wpa_supplicant/events.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index ca27946384..bfe3d85e8f 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2167,6 +2167,20 @@  int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
 		MAC2STR(selected->bssid), selected->freq, selected->level,
 		selected->snr, selected->est_throughput);
 
+	if (wpa_s->valid_links) {
+		u8 i;
+
+		for_each_link(wpa_s->valid_links, i) {
+			if (ether_addr_equal(wpa_s->links[i].bssid,
+					     selected->bssid)) {
+				wpa_dbg(wpa_s, MSG_DEBUG,
+					"MLD: associated to selected BSS link_id=%u",
+					i);
+				return 0;
+			}
+		}
+	}
+
 	if (wpa_s->current_ssid->bssid_set &&
 	    ether_addr_equal(selected->bssid, wpa_s->current_ssid->bssid)) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "Allow reassociation - selected BSS "