]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
hostapd: ucode: force restart on unresolvable static BSSID conflict
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 12:43:40 +0000 (14:43 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:22 +0000 (11:50 +0200)
The guard meant to bail to a full restart read `!mac_idx < 0`, which parses
as `(!mac_idx) < 0` and is always false, so a static BSSID colliding with
the first (or a foreign-owned) BSS fell through and reassigned the wrong
BSS's address. Use `mac_idx <= 0`.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/files/hostapd.uc

index 4b85fd28637ea324e69750b1f04b5acecb295258..98e8dc9f8403caf498ca8db1b7bfbfac2dc6f6db 100644 (file)
@@ -859,7 +859,7 @@ function iface_reload_config(name, phydev, config, old_config)
                // with the bssid of a reused interface. reassign the reused interface
                if (!bsscfg.default_macaddr) {
                        // can't update bssid of the first BSS, need to restart
-                       if (!mac_idx < 0)
+                       if (mac_idx <= 0)
                                return false;
 
                        bsscfg = config.bss[mac_idx];