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>
return;
}
+ if (wdev.config_change)
+ wdev_config_init(wdev);
+
wdev.setup();
}
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();
}