]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Remove redundant outer loop in hostapd_notif_disassoc_mld()
authorSai Pratyusha Magam <smagam@qti.qualcomm.com>
Mon, 18 Aug 2025 17:47:09 +0000 (23:17 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 21 Aug 2025 21:24:52 +0000 (00:24 +0300)
The outer loop in hostapd_notif_disassoc_mld() is not required to
iterate through affiliated AP links in an AP MLD. The inner loop alone
is sufficient for this. So cleanup the outer loop.

No functional changes involved.

Signed-off-by: Sai Pratyusha Magam <smagam@qti.qualcomm.com>
src/ap/drv_callbacks.c

index aebd52c0c7456789b501a8806284c47eca15ddd6..c38d76b3a69001556a7a5f73880fbc10a992a051 100644 (file)
@@ -1026,29 +1026,24 @@ static void hostapd_remove_sta(struct hostapd_data *hapd, struct sta_info *sta)
 void hostapd_notif_disassoc_mld(struct hostapd_data *assoc_hapd,
                                struct sta_info *sta, const u8 *addr)
 {
-       unsigned int link_id, i;
+       unsigned int i;
        struct hostapd_data *tmp_hapd;
        struct hapd_interfaces *interfaces = assoc_hapd->iface->interfaces;
 
        /* Remove STA entry in non-assoc links */
-       for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
-               if (!sta->mld_info.links[link_id].valid)
-                       continue;
-
-               for (i = 0; i < interfaces->count; i++) {
-                       struct sta_info *tmp_sta;
+       for (i = 0; i < interfaces->count; i++) {
+               struct sta_info *tmp_sta;
 
-                       tmp_hapd = interfaces->iface[i]->bss[0];
+               tmp_hapd = interfaces->iface[i]->bss[0];
 
-                       if (!tmp_hapd->conf->mld_ap ||
-                           assoc_hapd == tmp_hapd ||
-                           assoc_hapd->conf->mld_id != tmp_hapd->conf->mld_id)
-                               continue;
+               if (!tmp_hapd->conf->mld_ap ||
+                   assoc_hapd == tmp_hapd ||
+                   assoc_hapd->conf->mld_id != tmp_hapd->conf->mld_id)
+                       continue;
 
-                       tmp_sta = ap_get_sta(tmp_hapd, addr);
-                       if (tmp_sta)
-                               ap_free_sta(tmp_hapd, tmp_sta);
-               }
+               tmp_sta = ap_get_sta(tmp_hapd, addr);
+               if (tmp_sta)
+                       ap_free_sta(tmp_hapd, tmp_sta);
        }
 
        /* Remove STA in assoc link */