[PATCH 12/16] hostapd: MLO: refresh other iface beacons when one iface gets disabled/enabled

Aditya Kumar Singh quic_adisi at quicinc.com
Wed Mar 6 09:39:43 PST 2024


If one or more bss from the iface is partnering with bsses from other
iface and if this iface gets disabled, then the beacons needs to be
refreshed for other ifaces. Similar thing should happen when it gets
enabled.

Add logic to refresh other iface beacons when one of the iface is disabled
or enabled.

Signed-off-by: Aditya Kumar Singh <quic_adisi at quicinc.com>
---
 src/ap/hostapd.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a8ae0130fef6..0171649b21cc 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -58,6 +58,7 @@
 #include "wpa_auth_kay.h"
 #include "hw_features.h"
 
+static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface);
 
 static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
 #ifdef CONFIG_WEP
@@ -3398,6 +3399,8 @@ int hostapd_enable_iface(struct hostapd_iface *hapd_iface)
 		return -1;
 	}
 
+	hostapd_refresh_all_iface_beacons(hapd_iface);
+
 	return 0;
 }
 
@@ -3437,6 +3440,22 @@ int hostapd_reload_bss_only(struct hostapd_data *bss)
 }
 
 
+static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface)
+{
+	size_t j;
+
+	if (!hapd_iface || !hapd_iface->interfaces ||
+	    hapd_iface->interfaces->count <= 1)
+		return;
+
+	for (j = 0; j < hapd_iface->interfaces->count; j++) {
+		if (hapd_iface->interfaces->iface[j] == hapd_iface)
+			continue;
+
+		ieee802_11_update_beacons(hapd_iface->interfaces->iface[j]);
+	}
+}
+
 int hostapd_disable_iface(struct hostapd_iface *hapd_iface)
 {
 	size_t j;
@@ -3510,6 +3529,7 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface)
 	wpa_printf(MSG_DEBUG, "Interface %s disabled",
 		   hapd_iface->bss[0]->conf->iface);
 	hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED);
+	hostapd_refresh_all_iface_beacons(hapd_iface);
 	return 0;
 }
 
-- 
2.25.1




More information about the Hostap mailing list