X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=config.c;h=536b7d3fa6073c21375aadfdd4e323a41ecb1e99;hp=0d965d33bd714a6a00882ecac6be95384e6b852b;hb=b409c78066ea6fe2c2451ede86a2303c413b5e4b;hpb=8bf5df1d052a853579c0474dabc87af2d113fb53 diff --git a/config.c b/config.c index 0d965d3..536b7d3 100644 --- a/config.c +++ b/config.c @@ -301,12 +301,6 @@ config_init_globals(void) const char *ula_prefix = uci_lookup_option_string( uci_ctx, globals, "ula_prefix"); interface_ip_set_ula_prefix(ula_prefix); - - const char *default_ps = uci_lookup_option_string( - uci_ctx, globals, "default_ps"); - - if (default_ps) - device_set_default_ps(strcmp(default_ps, "1") ? false : true); } static void @@ -393,16 +387,27 @@ config_init_wireless(void) vlist_flush(&wdev->interfaces); } -void +int config_init_all(void) { + int ret = 0; + char *err; + uci_network = config_init_package("network"); if (!uci_network) { - fprintf(stderr, "Failed to load network config\n"); - return; + uci_get_errorstr(uci_ctx, &err, NULL); + netifd_log_message(L_CRIT, "Failed to load network config (%s)\n", err); + free(err); + return -1; } uci_wireless = config_init_package("wireless"); + if (!uci_wireless && uci_ctx->err != UCI_ERR_NOTFOUND) { + uci_get_errorstr(uci_ctx, &err, NULL); + netifd_log_message(L_CRIT, "Failed to load wireless config (%s)\n", err); + free(err); + ret = -1; + } vlist_update(&interfaces); config_init = true; @@ -426,4 +431,6 @@ config_init_all(void) interface_refresh_assignments(false); interface_start_pending(); wireless_start_pending(); + + return ret; }