[PATCH 1/2] ap: make sure ssid changes are considered as significant reconfig
Michal Kazior
kazikcz at gmail.com
Thu Oct 22 03:34:01 PDT 2026
From: Michal Kazior <michal at plume.com>
The nl80211 driver can typically set the AP
parameters in 2 ways from within a single flow:
a. NL80211_CMD_START_AP
b. NL80211_CMD_SET_BEACON
They aren't equivalent though. Not every single
parameter that START_AP allows to set can be
changed with SET_BEACON.
One such thing is the SSID. It seems that it can
be done and in fact it *can* work if some
constraints are met.
However fundamentally SET_BEACON does not allow
changing SSID at the API level. It happens to
allow reloading the Beacon template and such, but
it does not update a number of things:
internal wdev->u.ap.ssid, or other internals
within specific drivers.
There's no way to fix this at the nl80211 level
because adding extra sanity checks would arguably
break older userspace expectations and (possibly
already working) integrations.
This change makes sure the current user of this
helper - hostapd_reload_config() - can infer that
it needs to remove+add the interface instead of a
mere refresh. This in turns makes sure that
nl80211 goes through STOP_AP + START_AP commands
instead of the (incorrect) SET_BEACON.
Signed-off-by: Michal Kazior <michal at plume.com>
---
src/ap/hostapd.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a4394f73d..6d653bfc9 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -247,6 +247,14 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
if (os_strcmp(newconf->bss[i]->iface,
oldconf->bss[i]->iface) != 0)
return 1;
+ if (newconf->bss[i]->ssid.ssid_set &&
+ oldconf->bss[i]->ssid.ssid_set &&
+ (newconf->bss[i]->ssid.ssid_len !=
+ oldconf->bss[i]->ssid.ssid_len ||
+ os_memcmp(newconf->bss[i]->ssid.ssid,
+ oldconf->bss[i]->ssid.ssid,
+ oldconf->bss[i]->ssid.ssid_len) != 0))
+ return 1;
#ifdef CONFIG_IEEE80211BE
if (newconf->bss[i]->mld_ap != oldconf->bss[i]->mld_ap)
return 1;
--
2.55.0
More information about the Hostap
mailing list