projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor cleanup
[project/netifd.git]
/
config.c
diff --git
a/config.c
b/config.c
index
9f42471
..
4158cc8
100644
(file)
--- a/
config.c
+++ b/
config.c
@@
-330,34
+330,37
@@
config_init_package(const char *config)
return p;
}
return p;
}
-void
-config_init_interfaces(
const char *name
)
+
static
void
+config_init_interfaces(
void
)
{
{
- struct uci_package *p = NULL;
struct uci_element *e;
struct uci_element *e;
- p = config_init_package("network");
- if (!p) {
+ uci_foreach_element(&uci_network->sections, e) {
+ struct uci_section *s = uci_to_section(e);
+
+ if (!strcmp(s->type, "interface"))
+ config_parse_interface(s);
+ }
+}
+
+void
+config_init_all(void)
+{
+ uci_network = config_init_package("network");
+ if (!uci_network) {
fprintf(stderr, "Failed to load network config\n");
return;
}
fprintf(stderr, "Failed to load network config\n");
return;
}
- uci_network = p;
config_init = true;
config_init = true;
+ device_lock();
device_reset_config();
config_init_devices();
device_reset_config();
config_init_devices();
+ config_init_interfaces();
- uci_foreach_element(&p->sections, e) {
- struct uci_section *s = uci_to_section(e);
-
- if (name && strcmp(s->e.name, name) != 0)
- continue;
-
- if (!strcmp(s->type, "interface"))
- config_parse_interface(s);
- }
config_init = false;
config_init = false;
+ device_unlock();
device_reset_old();
device_init_pending();
device_reset_old();
device_init_pending();