diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-11-18 15:15:01 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-11-18 15:36:49 +0100 |
commit | c1c2728946b5bedb7a4757d9dd95744dc7d2f1ec (patch) | |
tree | 9b9cea09f662c4ba0383cc83894ee5f0ef5348a6 | |
parent | 351d690f1a09e062ef951ac406ee571e1f1fe3e6 (diff) | |
download | netifd-c1c2728946b5bedb7a4757d9dd95744dc7d2f1ec.tar.gz |
config: initialize bridge and bridge vlans before other devices
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>
-rw-r--r-- | config.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -221,7 +221,7 @@ config_parse_rule(struct uci_section *s, bool v6) } static void -config_init_devices(void) +config_init_devices(bool bridge) { struct uci_element *e; @@ -243,6 +243,9 @@ config_init_devices(void) if (type) devtype = device_type_get(type); + if (bridge != (devtype && devtype->bridge_capability)) + continue; + if (devtype) params = devtype->config_params; if (!params) @@ -672,9 +675,10 @@ config_init_all(void) 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(); |