dns: don't fall back to other methods when resolvconf or netconfig fail
This commit is contained in:
@@ -684,7 +684,6 @@ update_dns (NMDnsManager *self,
|
|||||||
|
|
||||||
if (priv->resolv_conf_mode == NM_DNS_MANAGER_RESOLV_CONF_UNMANAGED) {
|
if (priv->resolv_conf_mode == NM_DNS_MANAGER_RESOLV_CONF_UNMANAGED) {
|
||||||
update = FALSE;
|
update = FALSE;
|
||||||
success = TRUE;
|
|
||||||
nm_log_dbg (LOGD_DNS, "not updating resolv.conf");
|
nm_log_dbg (LOGD_DNS, "not updating resolv.conf");
|
||||||
} else {
|
} else {
|
||||||
priv->dns_touched = TRUE;
|
priv->dns_touched = TRUE;
|
||||||
@@ -827,25 +826,19 @@ update_dns (NMDnsManager *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (update) {
|
if (update) {
|
||||||
#ifdef RESOLVCONF_PATH
|
#if defined(RESOLVCONF_PATH)
|
||||||
success = dispatch_resolvconf (searches, nameservers, error);
|
success = dispatch_resolvconf (searches, nameservers, error);
|
||||||
#endif
|
#elif defined(NETCONFIG_PATH)
|
||||||
|
success = dispatch_netconfig (searches, nameservers, nis_domain,
|
||||||
#ifdef NETCONFIG_PATH
|
nis_servers, error);
|
||||||
if (success == FALSE) {
|
#else
|
||||||
success = dispatch_netconfig (searches, nameservers,
|
|
||||||
nis_domain, nis_servers, error);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (update && !success) {
|
|
||||||
success = update_resolv_conf (searches, nameservers, error, TRUE);
|
success = update_resolv_conf (searches, nameservers, error, TRUE);
|
||||||
} else {
|
#endif
|
||||||
/* Only update private resolv.conf in NMRUNDIR, ignore errors */
|
|
||||||
update_resolv_conf (searches, nameservers, error, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Only update private resolv.conf in NMRUNDIR, ignore errors */
|
||||||
|
update_resolv_conf (searches, nameservers, error, FALSE);
|
||||||
|
|
||||||
/* signal that resolv.conf was changed */
|
/* signal that resolv.conf was changed */
|
||||||
if (update && success)
|
if (update && success)
|
||||||
g_signal_emit (self, signals[CONFIG_CHANGED], 0);
|
g_signal_emit (self, signals[CONFIG_CHANGED], 0);
|
||||||
@@ -857,7 +850,7 @@ update_dns (NMDnsManager *self,
|
|||||||
if (nis_servers)
|
if (nis_servers)
|
||||||
g_strfreev (nis_servers);
|
g_strfreev (nis_servers);
|
||||||
|
|
||||||
return success;
|
return !update || success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user