summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2025-08-04 09:46:05 +0000
committerFelix Fietkau2025-08-04 09:46:42 +0000
commitde447b93e084862a105ecbddac1ea4d56309f888 (patch)
tree6e205477e2466210662d4729ca2b609de6bc0bd2
parentf3dd291b62c0578db2982c58cf5105aad54be1d7 (diff)
downloadopenwrt-de447b93e084862a105ecbddac1ea4d56309f888.tar.gz
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@nbd.name>
-rw-r--r--package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc10
1 files 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)