From: Gautham Kumar Senthilkumaran Date: Thu, 20 Mar 2025 14:56:45 +0000 (+0530) Subject: AP MLD: Avoid deletion of ML station if some links are rejected X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39bd3104d47bcbcf34d4f71e90ba00571dab2e4d;p=thirdparty%2Fhostap.git AP MLD: Avoid deletion of ML station if some links are rejected 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 Signed-off-by: Rameshkumar Sundaram --- diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index b2fd51b31..cfc2082b6 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -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);