diff mbox series

[2/6] AP: MLD: Fix station lookup in hostapd_ml_get_assoc_sta()

Message ID 20231225174303.4066419-2-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series [1/6] AP: Unify code handling deauthentication/disassociation | expand

Commit Message

Andrei Otcheretianski Dec. 25, 2023, 5:42 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

If the station is not an MLO station do not attempt to find
the association station and return false.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/ap/ieee802_11.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index a939ad35e2..95b43029bb 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -5739,6 +5739,9 @@  hostapd_ml_get_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
 	struct hostapd_data *other_hapd = NULL;
 	struct sta_info *tmp_sta;
 
+	if (!sta->mld_info.mld_sta)
+		return NULL;
+
 	*assoc_hapd = hapd;
 
 	/* The station is the one on which the association was performed */
@@ -5787,6 +5790,8 @@  static bool hostapd_ml_handle_disconnect(struct hostapd_data *hapd,
 	 * the information about all the other links.
 	 */
 	assoc_sta = hostapd_ml_get_assoc_sta(hapd, sta, &assoc_hapd);
+	if (!assoc_sta)
+		return false;
 
 	for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
 		for (i = 0; i < assoc_hapd->iface->interfaces->count; i++) {