diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-19 22:13:10 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-19 22:13:10 +0200 |
commit | 5eefbc1a53e34db35c9a567d147c6d0bd341cf18 (patch) | |
tree | d37c0604260865ffda743d44919811b56cb50cf0 | |
parent | 1ba3b8a006b57646d55522bb9efa77769361ff39 (diff) |
minor cleanup
-rw-r--r-- | config.c | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -330,31 +330,34 @@ config_init_package(const char *config) return p; } -void -config_init_all(void) +static void +config_init_interfaces(void) { - struct uci_package *p = NULL; 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; } - uci_network = p; config_init = true; device_lock(); device_reset_config(); config_init_devices(); - - uci_foreach_element(&p->sections, e) { - struct uci_section *s = uci_to_section(e); - - if (!strcmp(s->type, "interface")) - config_parse_interface(s); - } + config_init_interfaces(); config_init = false; device_unlock(); |