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 <nbd@nbd.name>
This commit is contained in:
parent
f3ff33c8a9
commit
830ae67b44
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue