From a5188103220ddd810ed8b67fce51d7526157a7ec Mon Sep 17 00:00:00 2001 From: Sriram R Date: Thu, 28 Mar 2024 23:46:43 +0530 Subject: [PATCH] AP MLD: Handle link_id in EAPOL RX handler Add link ID support into EAPOL RX handler so that the events can be routed to the appropriate link BSSs. Signed-off-by: Sriram R Signed-off-by: Aditya Kumar Singh --- src/ap/drv_callbacks.c | 55 ++---------------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 00b1a7650..853801a8b 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -2023,38 +2023,6 @@ static struct hostapd_data * hostapd_find_by_sta(struct hostapd_iface *iface, } -#ifdef CONFIG_IEEE80211BE -static bool search_mld_sta(struct hostapd_data **p_hapd, const u8 *src) -{ - struct hostapd_data *hapd = *p_hapd; - unsigned int i; - - /* Search for STA on other MLO BSSs */ - for (i = 0; i < hapd->iface->interfaces->count; i++) { - struct hostapd_iface *h = - hapd->iface->interfaces->iface[i]; - struct hostapd_data *h_hapd = h->bss[0]; - - if (!hostapd_is_ml_partner(h_hapd, hapd)) - continue; - - h_hapd = hostapd_find_by_sta(h, src, false, NULL); - if (h_hapd) { - struct sta_info *sta = ap_get_sta(h_hapd, src); - - if (sta && sta->mld_info.mld_sta && - sta->mld_assoc_link_id != h_hapd->mld_link_id) - continue; - *p_hapd = h_hapd; - return true; - } - } - - return false; -} -#endif /* CONFIG_IEEE80211BE */ - - static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src, const u8 *data, size_t data_len, enum frame_encryption encrypted, @@ -2063,27 +2031,8 @@ static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src, struct hostapd_data *orig_hapd = hapd; #ifdef CONFIG_IEEE80211BE - if (link_id != -1) { - struct hostapd_data *h_hapd; - - hapd = switch_link_hapd(hapd, link_id); - h_hapd = hostapd_find_by_sta(hapd->iface, src, true, NULL); - if (!h_hapd) - h_hapd = hostapd_find_by_sta(orig_hapd->iface, src, - true, NULL); - if (!h_hapd) - h_hapd = hostapd_find_by_sta(hapd->iface, src, false, - NULL); - if (!h_hapd) - h_hapd = hostapd_find_by_sta(orig_hapd->iface, src, - false, NULL); - if (h_hapd) - hapd = h_hapd; - } else if (hapd->conf->mld_ap) { - search_mld_sta(&hapd, src); - } else { - hapd = hostapd_find_by_sta(hapd->iface, src, false, NULL); - } + hapd = switch_link_hapd(hapd, link_id); + hapd = hostapd_find_by_sta(hapd->iface, src, true, NULL); #else /* CONFIG_IEEE80211BE */ hapd = hostapd_find_by_sta(hapd->iface, src, false, NULL); #endif /* CONFIG_IEEE80211BE */