diff --git a/src/netconfig.c b/src/netconfig.c index c4785fb6..b075f893 100644 --- a/src/netconfig.c +++ b/src/netconfig.c @@ -1126,10 +1126,18 @@ static int netconfig_init(void) return -EALREADY; if (!l_settings_get_bool(iwd_get_config(), "General", - "enable_network_config", &enabled) || - !enabled) { - l_warn("netconfig: Network configuration with the IP addresses " - "is disabled."); + "EnableNetworkConfiguration", + &enabled)) { + if (l_settings_get_bool(iwd_get_config(), "General", + "enable_network_config", &enabled)) + l_warn("[General].enable_network_config is deprecated," + " use [General].EnableNetworkConfiguration"); + else + enabled = false; + } + + if (!enabled) { + l_info("netconfig: Network configuration is disabled."); return 0; } @@ -1172,8 +1180,8 @@ static int netconfig_init(void) goto error; } - if (!l_settings_get_uint(iwd_get_config(), "General", - "route_priority_offset", + if (!l_settings_get_uint(iwd_get_config(), "Network", + "RoutePriorityOffset", &ROUTE_PRIORITY_OFFSET)) ROUTE_PRIORITY_OFFSET = 300; diff --git a/src/resolve.c b/src/resolve.c index b502feb8..ca0ffa4d 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -399,16 +399,27 @@ static int resolve_init(void) uint8_t i; if (!l_settings_get_bool(iwd_get_config(), "General", - "enable_network_config", &enabled) || - !enabled) + "EnableNetworkConfiguration", + &enabled)) { + if (!l_settings_get_bool(iwd_get_config(), "General", + "enable_network_config", &enabled)) + enabled = false; + } + + if (!enabled) return 0; - method_name = l_settings_get_value(iwd_get_config(), "General", + method_name = l_settings_get_value(iwd_get_config(), "Network", + "NameResolvingService"); + if (!method_name) { + method_name = l_settings_get_value(iwd_get_config(), "General", "dns_resolve_method"); - - if (!method_name) - /* Default to systemd-resolved service. */ - method_name = "systemd"; + if (method_name) + l_warn("[General].dns_resolve_method is deprecated, " + "use [Network].NameResolvingService"); + else /* Default to systemd-resolved service. */ + method_name = "systemd"; + } for (i = 0; resolve_method_ops_list[i].name; i++) { if (strcmp(resolve_method_ops_list[i].name, method_name)) @@ -419,8 +430,10 @@ static int resolve_init(void) break; } - if (!method.ops) + if (!method.ops) { + l_error("Unknown resolution method: %s", method_name); return -EINVAL; + } if (method.ops->init) method.data = method.ops->init();