wifi-scripts: ucode: fix invalid generated MAC address

macaddr_base can be NULL, in which case it needs to be passed as an empty string

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2025-06-27 13:08:32 +02:00
parent 165ca3f375
commit ba2ae60a00

View file

@ -231,7 +231,7 @@ function macaddr_random() {
let mac_idx = 0;
export function prepare(data, phy, num_global_macaddr, macaddr_base) {
if (!data.macaddr) {
let pipe = fs.popen(`ucode /usr/share/hostap/wdev.uc ${phy} get_macaddr id=${mac_idx} num_global=${num_global_macaddr} mbssid=${data.mbssid ?? 0} macaddr_base=${macaddr_base}`);
let pipe = fs.popen(`ucode /usr/share/hostap/wdev.uc ${phy} get_macaddr id=${mac_idx} num_global=${num_global_macaddr} mbssid=${data.mbssid ?? 0} macaddr_base=${macaddr_base ?? ""}`);
data.macaddr = trim(pipe.read("all"), '\n');
pipe.close();