From: Felix Fietkau Date: Fri, 10 Jul 2026 11:58:33 +0000 (+0200) Subject: wifi-scripts: honour a cancelled setup when the handler reports up X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=830ae67b44ef01f7d41c03e1296dd6d26acac2b9;p=thirdparty%2Fopenwrt.git wifi-scripts: honour a cancelled setup when the handler reports up stop() and destroy() set cancel_setup while a setup handler is running, but nothing read it, so a device brought down (or removed) mid-setup still went up and stayed up, holding its interface links. Check the flag (and autostart/delete) in wdev_mark_up and tear the device down instead of completing the up transition. 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 f55fc311890..d32948c711c 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 @@ -453,6 +453,12 @@ function wdev_mark_up(wdev) if (wdev.state != "setup") return; + if (wdev.cancel_setup || !wdev.autostart || wdev.delete) { + delete wdev.cancel_setup; + wdev.teardown(); + return 0; + } + for (let section, data in wdev.handler_data) { if (data.ifname) handle_link(data.ifname, data, true);