hostapd: add extra sanity checks for config reload
authorFelix Fietkau <nbd@nbd.name>
Tue, 8 Aug 2023 18:11:42 +0000 (20:11 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 8 Aug 2023 18:11:43 +0000 (20:11 +0200)
Avoid getting stuck because of bad configurations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/files/hostapd.uc

index cc026cc853d23167b9e587b69beb15e0f3e29ea1..b52732adcb7f4a912fbe489979eb0f5258c40954 100644 (file)
@@ -117,6 +117,9 @@ function iface_reload_config(phy, config, old_config)
        if (is_equal(old_config.bss, config.bss))
                return true;
 
+       if (!old_config.bss || !old_config.bss[0])
+               return false;
+
        if (config.bss[0].ifname != old_config.bss[0].ifname)
                return false;