]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: fix handling changes to the wifi device disabled flag
authorFelix Fietkau <nbd@nbd.name>
Mon, 4 Aug 2025 09:46:05 +0000 (11:46 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 4 Aug 2025 09:46:42 +0000 (11:46 +0200)
Allow toggling autostart even for disabled devices
When switching from enabled to disabled, call teardown instead of setup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc

index 8d2ea051fe4864d4ebd61baaa4b073e839ebbefc..22f5ee54d97388e0278ef0a44c244e88b75356e1 100644 (file)
@@ -391,11 +391,14 @@ function update(data)
 
 function start()
 {
-       if (this.delete || this.data.config.disabled)
+       if (this.delete)
                return;
 
        this.dbg("start, state=" + this.state);
        this.autostart = true;
+       if (this.data.config.disabled)
+               return;
+
        wdev_reset(this);
 
        if (this.state != "down")
@@ -427,7 +430,10 @@ function check()
                return;
 
        wdev_config_init(this);
-       this.setup();
+       if (this.data.config.disabled)
+               this.teardown();
+       else
+               this.setup();
 }
 
 function wdev_mark_up(wdev)