From 12c8bba73123dce47c1f8d0eddebefb485341704 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 13 Jan 2024 15:22:27 +0100 Subject: [PATCH] hostapd: fix an exception in hostapd.uc on interface add failure Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 0c89cd71cc..5bffdff83f 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -128,6 +128,7 @@ function __iface_pending_next(pending, state, ret, data) let config = pending.config; let phydev = pending.phydev; let phy = pending.phy; + let bss = config.bss[0]; if (pending.defer) pending.defer.abort(); @@ -140,7 +141,6 @@ function __iface_pending_next(pending, state, ret, data) pending.call("wpa_supplicant", "phy_set_macaddr_list", { phy: phy, macaddr: macaddr_list }); return "create_bss"; case "create_bss": - let bss = config.bss[0]; let err = wdev_create(phy, bss.ifname, { mode: "ap" }); if (err) { hostapd.printf(`Failed to create ${bss.ifname} on phy ${phy}: ${err}`); -- 2.30.2