wifi-scripts: don't swap handler config under a running setup script

A reload during an in-flight setup ran wdev_config_init() immediately,
replacing handler_config/handler_data while the script was still running, so
its set_data notifications resolved against the new (renumbered) interface
table and link up/down calls became asymmetric. Defer the re-init in
check() while a handler run is in progress and re-apply from the setup and
teardown callbacks once it completes.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2026-07-16 11:50:22 +02:00
parent e6bd2af652
commit 766052bab3
@@ -173,6 +173,9 @@ function wdev_teardown_cb(wdev)
return;
}
if (wdev.config_change)
wdev_config_init(wdev);
wdev.setup();
}
@@ -443,6 +446,14 @@ function check()
if (!wdev_update_disabled_vifs(this))
return;
/*
* Defer applying a new config while a handler run is in progress: the
* running script keeps its start-time config, and the setup/teardown
* callback re-applies once it finishes (config_change stays set).
*/
if (this.state != "up" && this.state != "down")
return;
wdev_config_init(this);
this.setup();
}