[openwrt/openwrt] wifi-scripts: fix handling changes to the wifi device disabled flag

LEDE Commits lede-commits at lists.infradead.org
Mon Aug 4 02:46:49 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/de447b93e084862a105ecbddac1ea4d56309f888

commit de447b93e084862a105ecbddac1ea4d56309f888
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Aug 4 11:46:05 2025 +0200

    wifi-scripts: fix handling changes to the wifi device disabled flag
    
    Allow toggling autostart even for disabled devices
    When switching from enabled to disabled, call teardown instead of setup
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../config/wifi-scripts/files/lib/netifd/wireless-device.uc    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
index 8d2ea051fe..22f5ee54d9 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc
@@ -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)




More information about the lede-commits mailing list