Skip to content

Commit f43bf55

Browse files
committed
wifi-scripts: allow configuring per-radio macaddr in shared/mlo wifi-iface
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>
1 parent 6fbf6d0 commit f43bf55

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • package/network/config/wifi-scripts/files/lib/netifd

package/network/config/wifi-scripts/files/lib/netifd/wireless.uc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ function config_init(uci)
128128
config.mode = "link";
129129
config.radios = radios;
130130

131+
if (dev_name != dev_names[0])
132+
delete config.macaddr;
133+
if (dev_name != wdev.mlo_name && config.radio_macaddr) {
134+
let idx = index(dev_names, dev_name);
135+
if (mlo_vif)
136+
idx--;
137+
let macaddr = idx >= 0 ? config.radio_macaddr[idx] : null;
138+
if (macaddr)
139+
config.macaddr = macaddr;
140+
}
141+
131142
let vif = {
132143
name, config,
133144
device: dev_name,
@@ -310,6 +321,7 @@ const default_config_attr = {
310321
...network_config_attr,
311322
device: TYPE_STRING,
312323
mode: TYPE_STRING,
324+
radio_macaddr: TYPE_ARRAY,
313325
},
314326
station: {
315327
iface: TYPE_STRING,

0 commit comments

Comments
 (0)