wifi-scripts: reserve the addresses of MLD interfaces

macaddr_init() calls for_each_wdev() to mark the addresses that are in
use. for_each_wdev() kept a wdev only if the radio mask of the wdev named
the radio of the allocation and no other radio. An MLD uses more than one
radio. Therefore no MLD matched, and the address of each MLD stayed free.

The configuration describes the AP MLDs, and the code reserves them with
the configuration. The MLD of the supplicant is different: hostapd is the
only source of its address. The code gave that address a second time, and
the new interface failed to start:

  Could not set interface phy0.0-ap1 flags (UP)
  Failed to add BSS (BSSID=a2:ad:9f:70:fb:46)

Keep a wdev if it uses the radio, also when it uses other radios.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau committed 2026-08-21 18:09:29 +02:00
1 parent b9b8760e8a
commit 8a40ffd07f
1 file changed
+1 -1
@@ -316,7 +316,7 @@ const phy_proto = {
if (wdev.iftype == nl80211.const.NL80211_IFTYPE_AP_VLAN)
continue;
if (this.radio != null && wdev.vif_radio_mask != null &&
wdev.vif_radio_mask != (1 << this.radio))
!(wdev.vif_radio_mask & (1 << this.radio)))
continue;
mac_wdev[wdev.mac] = wdev;
}