hostapd: fix undeclared variable iface_name
authorNazar Mokrynskyi <nazar@mokrynskyi.com>
Tue, 14 Nov 2023 03:49:28 +0000 (05:49 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sun, 19 Nov 2023 18:10:42 +0000 (19:10 +0100)
Signed-off-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
package/network/services/hostapd/files/hostapd.uc

index 593840cca88fbe45b438e5eb24ca7dd2de41c87e..750fd535a4adc6667f0c94aa1a48ba6be3c052d5 100644 (file)
@@ -278,12 +278,12 @@ function iface_reload_config(phydev, config, old_config)
                return false;
 
        let iface = hostapd.interfaces[phy];
+       let iface_name = old_config.bss[0].ifname;
        if (!iface) {
                hostapd.printf(`Could not find previous interface ${iface_name}`);
                return false;
        }
 
-       let iface_name = old_config.bss[0].ifname;
        let first_bss = hostapd.bss[iface_name];
        if (!first_bss) {
                hostapd.printf(`Could not find bss of previous interface ${iface_name}`);