]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: honour a cancelled setup when the handler reports up
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 11:58:33 +0000 (13:58 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:21 +0000 (11:50 +0200)
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 <nbd@nbd.name>
package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc

index f55fc3118904e053277b64ff626b22ec06e75cea..d32948c711cb17760e6f4b41a26fc804d06032e7 100644 (file)
@@ -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);