This allows vlan devices to access bridge vlan data safely, regardless
of the order in which sections appear in the config
Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
static void
-config_init_devices(void)
+config_init_devices(bool bridge)
{
struct uci_element *e;
if (type)
devtype = device_type_get(type);
+ if (bridge != (devtype && devtype->bridge_capability))
+ continue;
+
if (devtype)
params = devtype->config_params;
if (!params)
device_lock();
device_reset_config();
- config_init_devices();
- config_init_interfaces();
+ config_init_devices(true);
config_init_vlans();
+ config_init_devices(false);
+ config_init_interfaces();
config_init_ip();
config_init_rules();
config_init_globals();