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>
// 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];