]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Refresh beacons for other links when one gets disabled/enabled
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Wed, 6 Mar 2024 06:39:43 +0000 (12:09 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 27 Mar 2024 16:12:39 +0000 (18:12 +0200)
If one or more BSS from the interface is partnering with BSSs from
another interface and if this interface gets disabled, the Beacon frames
need to be refreshed for other interfaces. Similar thing should happen
when it gets enabled.

Add logic to refresh other interface Beacon frames when one of the
interfaces is disabled or enabled.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/ap/hostapd.c

index 1e40e86edc61e87f1554c5dadeeb53d9a1d0c5ba..f94b89e8fc9a1d4305372cb4eeee54daf5846aef 100644 (file)
@@ -3355,6 +3355,22 @@ static void hostapd_deinit_driver(const struct wpa_driver_ops *driver,
 }
 
 
+static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface)
+{
+       size_t j;
+
+       if (!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_enable_iface(struct hostapd_iface *hapd_iface)
 {
        size_t j;
@@ -3393,6 +3409,8 @@ int hostapd_enable_iface(struct hostapd_iface *hapd_iface)
                return -1;
        }
 
+       hostapd_refresh_all_iface_beacons(hapd_iface);
+
        return 0;
 }
 
@@ -3504,6 +3522,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;
 }