interfaces: annotate device dependency issue #5540

The scope for this is larger (VLAN/QinQ/LAGG) so here we just try
to raise awareness for future refactor if other device types.
This commit is contained in:
Franco Fichtner 2022-03-02 11:00:06 +01:00
parent 94db2d45eb
commit 21643101eb

View File

@ -765,6 +765,7 @@ function interfaces_configure($verbose = false)
foreach ($list as $device => $if) {
/* pre-op: configuring the underlying device */
if (!empty($devices[$device])) {
/* XXX devices could depend on other devices */
log_msg("Device $device required for $if, configuring now", LOG_ERR);
call_user_func_array($devices[$device], [$device]);
unset($devices[$device]);
@ -786,6 +787,7 @@ function interfaces_configure($verbose = false)
/* last but not least start all unconfigured devices */
foreach ($devices as $name => $function) {
/* XXX devices could depend on other devices */
log_msg("Device $name is not assigned, configuring late", LOG_ERR);
call_user_func_array($function, [$name]);
}