]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
hostapd: ucode: handle null config in iface_set_config again
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 11:57:16 +0000 (13:57 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:21 +0000 (11:50 +0200)
config_reset and shutdown call iface_set_config(name) with no config, but
the null-config guard was dropped in the MLO rework, so config.phy
dereferenced null and threw: config_reset reset nothing and shutdown left
hostapd-created interfaces behind. Restore the guard, removing the stale
config entry and tearing the interface down via iface_config_remove.

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

index 3bb016e5dc6d424a5e8e65fb8208752dddce2f64..4b85fd28637ea324e69750b1f04b5acecb295258 100644 (file)
@@ -1009,6 +1009,11 @@ function iface_set_config(name, config)
 {
        let old_config = hostapd.data.config[name];
 
+       if (!config) {
+               delete hostapd.data.config[name];
+               return iface_config_remove(name, old_config);
+       }
+
        hostapd.data.config[name] = config;
 
        let phy = config.phy;