From: Sai Pratyusha Magam Date: Mon, 18 Aug 2025 17:47:09 +0000 (+0530) Subject: AP MLD: Remove redundant outer loop in hostapd_notif_disassoc_mld() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bbb8a66f64c952c53dc58545fc76a96b4dea385;p=thirdparty%2Fhostap.git AP MLD: Remove redundant outer loop in hostapd_notif_disassoc_mld() 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 --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index aebd52c0c..c38d76b3a 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -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 */