if ((!(sta->flags & WLAN_STA_MFP) ||
!ap_sta_is_authorized(sta)) && sta->wpa_sm) {
- wpa_auth_sta_deinit(sta->wpa_sm);
+ struct wpa_state_machine *sm = sta->wpa_sm;
+
+ clear_wpa_sm_for_all_sta(hapd, sm);
+ wpa_auth_sta_deinit(sm);
sta->wpa_sm = NULL;
clear_wpa_sm_for_each_partner_link(hapd, sta);
}
out:
if (resp != WLAN_STATUS_SUCCESS || assoc_wpa_sm) {
- wpa_auth_sta_deinit(sta->wpa_sm);
+ struct wpa_state_machine *sm = sta->wpa_sm;
+
+ clear_wpa_sm_for_all_sta(hapd, sm);
+ wpa_auth_sta_deinit(sm);
/* Only keep a reference to the main wpa_sm and drop the
* per-link instance.
set_wpa_sm_for_each_partner_link(hapd, psta, NULL);
}
+
+void clear_wpa_sm_for_all_sta(struct hostapd_data *hapd,
+ struct wpa_state_machine *wpa_sm)
+{
+ struct hostapd_data *lhapd;
+
+ if (!hapd->mld)
+ return;
+
+ for_each_mld_link(lhapd, hapd) {
+ struct sta_info *sta;
+
+ for (sta = lhapd->sta_list; sta; sta = sta->next) {
+ if (sta->wpa_sm == wpa_sm)
+ sta->wpa_sm = NULL;
+ }
+ }
+}
+
#endif /* CONFIG_IEEE80211BE */
struct sta_info *psta, void *wpa_sm);
void clear_wpa_sm_for_each_partner_link(struct hostapd_data *hapd,
struct sta_info *psta);
+void clear_wpa_sm_for_all_sta(struct hostapd_data *hapd,
+ struct wpa_state_machine *wpa_sm);
#endif /* STA_INFO_H */