[PATCH] nl80211: select a new assoc link on link removal
Benjamin Berg
benjamin at sipsolutions.net
Wed Oct 7 14:37:39 PDT 2026
From: Benjamin Berg <benjamin.berg at intel.com>
If a link is removed, then detect the removal of the assoc link. If that
happens, select a new link as the association link and update the assoc
BSSID.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
src/drivers/driver_nl80211_event.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 86f7372b59..34a4ce35c1 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -966,6 +966,19 @@ static void mlme_event_link_removal(struct wpa_driver_nl80211_data *drv,
drv->sta_mlo_info.valid_links &= ~removed_links;
drv->sta_mlo_info.req_links &= ~removed_links;
+ /*
+ * Set default BSSID to the BSSID of the lowest link ID of remaining
+ * links when the link used for (re)association is removed.
+ */
+ if (removed_links & BIT(drv->sta_mlo_info.assoc_link_id)) {
+ for_each_link(drv->sta_mlo_info.valid_links, i) {
+ os_memcpy(drv->bssid, drv->sta_mlo_info.links[i].bssid,
+ ETH_ALEN);
+ drv->sta_mlo_info.assoc_link_id = i;
+ break;
+ }
+ }
+
for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
if (!(removed_links & BIT(i)))
continue;
--
2.55.0
More information about the Hostap
mailing list