]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update beacon information in RNR/MSSID on interface unavailability
authorKarthik M <karthik.m@oss.qualcomm.com>
Fri, 21 Nov 2025 07:20:04 +0000 (12:50 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 25 Nov 2025 12:48:20 +0000 (14:48 +0200)
When an interface (legacy or MLD link) is deleted via userspace
tools (e.g., iw or ifconfig), the kernel indicates this through an
NL80211_CMD_STOP_AP event. hostapd marks the interface as stopped
and, for MLD, removes the corresponding link from the BSS list.
In MBSSID setups, if the deleted interface is the TX BSS,
the associated non‑TX BSSs are also removed.

However, hostapd does not update beacons of the remaining partner links
after this event. As a result, information about deleted/stopped BSSs
can persist in other beacons (e.g., as Reduced Neighbor Report entries),
which is incorrect.

Use the beacon_set_done flag to manage RNR/MBSSID beacon updates during
interface stop (NL_STOP_AP) and fix the issue by marking the stopped BSS
with beacon_set_done as zero, refreshing beacons for all active
interfaces, and ensuring stopped BSSs are excluded from RNR.

Signed-off-by: Karthik M <karthik.m@oss.qualcomm.com>
src/ap/drv_callbacks.c
src/ap/hostapd.c
src/ap/hostapd.h
src/ap/ieee802_11.c

index 16a15076cfd1126ee4f596f0dbbe3f812ec3b225..e1470c7e9af6a1679dd5f05e01ba3067745fbed8 100644 (file)
@@ -2270,6 +2270,10 @@ static void hostapd_event_iface_unavailable(struct hostapd_data *hapd)
                hostapd_switch_channel_fallback(hapd->iface,
                                                &hapd->cs_freq_params);
        }
+
+       /* Clear beacon_set_done so that the RNR and other beacon parameters
+        * are properly updated. */
+       hapd->beacon_set_done = 0;
 }
 
 
@@ -2801,6 +2805,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 #ifdef NEED_AP_MLME
        case EVENT_INTERFACE_UNAVAILABLE:
                hostapd_event_iface_unavailable(hapd);
+               /* Update beacon information in all other interfaces to cover
+                * removal/disabling of this BSS. */
+               hostapd_refresh_all_iface_beacons(hapd->iface);
                break;
        case EVENT_DFS_RADAR_DETECTED:
                if (!data)
index a57a151fa7bbe7481a7bc384c731c45851b32d57..d1e53ec074115adf9d0467e4464ae61c3ac855f3 100644 (file)
@@ -3578,7 +3578,7 @@ static void hostapd_deinit_driver(const struct wpa_driver_ops *driver,
 }
 
 
-static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface)
+void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface)
 {
        size_t j;
 
index 8ee341f764b6d7788a37a9887793af92d38b641c..2956981c739d7b7edc9e05188cdf2bb562b3ad41 100644 (file)
@@ -873,6 +873,7 @@ int hostapd_build_beacon_data(struct hostapd_data *hapd,
 void free_beacon_data(struct beacon_data *beacon);
 int hostapd_fill_cca_settings(struct hostapd_data *hapd,
                              struct cca_settings *settings);
+void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface);
 
 #ifdef CONFIG_IEEE80211BE
 
index 2df953a00abd2a2aa264d3b0321c6b235104132b..df315a3a5a708416b5aed1f3ff5619ed207b3c55 100644 (file)
@@ -8171,7 +8171,8 @@ repeat_rnr_len:
                        struct hostapd_data *bss = hapd->iface->bss[i];
                        bool ap_mld = false;
 
-                       if (!bss || !bss->conf || !bss->started)
+                       if (!bss || !bss->conf || !bss->started ||
+                           !bss->beacon_set_done)
                                continue;
 
 #ifdef CONFIG_IEEE80211BE
@@ -8449,7 +8450,8 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
 #endif /* CONFIG_IEEE80211BE */
 
        if (!bss || !bss->conf || !bss->started ||
-           bss == reporting_hapd || bss->conf->ignore_broadcast_ssid)
+           bss == reporting_hapd || bss->conf->ignore_broadcast_ssid ||
+           !bss->beacon_set_done)
                return false;
 
        if (hostapd_skip_rnr(i, skip_profiles, ap_mld, tbtt_info_len,