From: Felix Fietkau Date: Mon, 4 Aug 2025 09:46:05 +0000 (+0200) Subject: wifi-scripts: fix handling changes to the wifi device disabled flag X-Git-Tag: v25.12.0-rc1~1684 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de447b93e084862a105ecbddac1ea4d56309f888;p=thirdparty%2Fopenwrt.git 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 --- 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 8d2ea051fe4..22f5ee54d97 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)