diff mbox series

[1/2] AP: MLD: Do not modify flags for link stations

Message ID 20231128101410.1931280-1-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series [1/2] AP: MLD: Do not modify flags for link stations | expand

Commit Message

Andrei Otcheretianski Nov. 28, 2023, 10:14 a.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant
only for the MLD station and not to the link stations (as these flags
are related to the MLD state and not the link state).

As for the WPA_STA_SHORT_PREAMBLE, since the station is an EHT
station, it must have short preamble.

Thus, do not propagate the flags change for link stations to the
driver.

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

Comments

Jouni Malinen Dec. 6, 2023, 8:51 p.m. UTC | #1
On Tue, Nov 28, 2023 at 12:14:09PM +0200, Andrei Otcheretianski wrote:
> All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant
> only for the MLD station and not to the link stations (as these flags
> are related to the MLD state and not the link state).
> 
> As for the WPA_STA_SHORT_PREAMBLE, since the station is an EHT
> station, it must have short preamble.
> 
> Thus, do not propagate the flags change for link stations to the
> driver.

Thanks, both patches applied.
diff mbox series

Patch

diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 8f9cc5b360..d303f932f7 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -265,9 +265,41 @@  int hostapd_set_ap_wps_ie(struct hostapd_data *hapd)
 }
 
 
+static bool hostapd_sta_is_link_sta(struct hostapd_data *hapd,
+				    struct sta_info *sta)
+{
+	bool is_link_sta = false;
+
+#ifdef CONFIG_IEEE80211BE
+	if (hapd->conf->mld_ap && sta->mld_info.mld_sta &&
+	    sta->mld_assoc_link_id != hapd->mld_link_id)
+		is_link_sta = true;
+#endif /* CONFIG_IEEE80211BE */
+
+	return is_link_sta;
+}
+
+
 int hostapd_set_authorized(struct hostapd_data *hapd,
 			   struct sta_info *sta, int authorized)
 {
+	bool is_link_sta = hostapd_sta_is_link_sta(hapd, sta);
+
+	wpa_printf(MSG_DEBUG,
+		   "hostapd_set_authorized: authorized=%u", authorized);
+
+	/*
+	 * The WPA_STA_AUTHORIZED flag is relevant only for the MLD station and
+	 * not to the link stations (as the authorization is done between the
+	 * MLD peers). Thus, do not propagate the change to the driver for the
+	 * link stations.
+	 */
+	if (is_link_sta) {
+		wpa_printf(MSG_DEBUG,
+			   "hostapd_set_authorized: link station. No update");
+		return 0;
+	}
+
 	if (authorized) {
 		return hostapd_sta_set_flags(hapd, sta->addr,
 					     hostapd_sta_flags_to_drv(
@@ -284,8 +316,26 @@  int hostapd_set_authorized(struct hostapd_data *hapd,
 int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta)
 {
 	int set_flags, total_flags, flags_and, flags_or;
+	bool is_link_sta = hostapd_sta_is_link_sta(hapd, sta);
+
 	total_flags = hostapd_sta_flags_to_drv(sta->flags);
 	set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP;
+
+	/*
+	 * All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant
+	 * only for the MLD station and not to the link stations (as these flags
+	 * are related to the MLD state and not the link state).
+	 * As for the WPA_STA_SHORT_PREAMBLE, since the station is an EHT
+	 * station, it must have short preamble.
+	 * Thus, do not propagate the change to the driver for the link
+	 * stations.
+	 */
+	if (is_link_sta) {
+		wpa_printf(MSG_DEBUG,
+			   "hostapd_set_sta_flags: link station. No update");
+		return 0;
+	}
+
 	if (((!hapd->conf->ieee802_1x && !hapd->conf->wpa) ||
 	     sta->auth_alg == WLAN_AUTH_FT) &&
 	    sta->flags & WLAN_STA_AUTHORIZED)