]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Avoid deletion of ML station if some links are rejected
authorGautham Kumar Senthilkumaran <quic_gauthamk@quicinc.com>
Thu, 20 Mar 2025 14:56:45 +0000 (20:26 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 20 Mar 2025 21:09:18 +0000 (23:09 +0200)
When a non-AP MLD requests ML association, an AP MLD will validate the
association request elements present in the parent profile as well as
the elements present in each STA profile of MLE to decide if link(s) can
be accepted. While doing so if some of the mandatory elements (say,
Capabilities, Basic rates, RSNEs, etc.) don't satisfy the necessary
conditions for the affiliated AP of the AP MLD to accept the link, the
link will be rejected.

In ieee80211_ml_process_links() this rejection happens even before the
link station entry is added to the driver and while trying to free this
sta object, __ap_free_sta() tries to delete the link station from the
driver which was never added at all and eventually this operation fails.
Currently if deletion of a link station fails hostapd deletes the whole
ML station from the driver but in the above scenario the other link(s)
are accepted. Such deletion results in complete association failure.

Fix this by not proceeding to delete the ML station completely if a
deletion of a link station fails. By design each link station entry of
hostapd should be scheduled for deletion and when the association link
station entry is scheduled for deletion, the ML station will be deleted
from the driver.

Fixes: a6d92da9aa44 ("AP MLD: Support removal of link station from AP")
Signed-off-by: Gautham Kumar Senthilkumaran <quic_gauthamk@quicinc.com>
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
src/ap/sta_info.c

index b2fd51b315b71fa797e9400717df9bcb7f240569..cfc2082b6711cde175332420df9f357ba9588376 100644 (file)
@@ -191,9 +191,10 @@ void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta)
 static void __ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
 {
 #ifdef CONFIG_IEEE80211BE
-       if (hostapd_sta_is_link_sta(hapd, sta) &&
-           !hostapd_drv_link_sta_remove(hapd, sta->addr))
+       if (hostapd_sta_is_link_sta(hapd, sta)) {
+               hostapd_drv_link_sta_remove(hapd, sta->addr);
                return;
+       }
 #endif /* CONFIG_IEEE80211BE */
 
        hostapd_drv_sta_remove(hapd, sta->addr);