wifi-scripts: allow configuring per-radio macaddr in shared/mlo wifi-iface
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run

When a wifi-iface section is used either for multiple vifs or MLD links,
make it possible to configure the per-radio/link macaddr.
When MLO is enabled, the main macaddr is used for the MLD interface.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2025-08-28 10:42:43 +02:00
parent 6fbf6d0cfd
commit f43bf55b41

View file

@ -128,6 +128,17 @@ function config_init(uci)
config.mode = "link";
config.radios = radios;
if (dev_name != dev_names[0])
delete config.macaddr;
if (dev_name != wdev.mlo_name && config.radio_macaddr) {
let idx = index(dev_names, dev_name);
if (mlo_vif)
idx--;
let macaddr = idx >= 0 ? config.radio_macaddr[idx] : null;
if (macaddr)
config.macaddr = macaddr;
}
let vif = {
name, config,
device: dev_name,
@ -310,6 +321,7 @@ const default_config_attr = {
...network_config_attr,
device: TYPE_STRING,
mode: TYPE_STRING,
radio_macaddr: TYPE_ARRAY,
},
station: {
iface: TYPE_STRING,