mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 02:10:17 +01:00
dns: fix generation of global configuration for dnsmasq
Fixes: ae9e82354a
This commit is contained in:
parent
3eb5037e1f
commit
96b11af92d
1 changed files with 6 additions and 6 deletions
|
|
@ -145,15 +145,15 @@ add_global_config (GString *str, const NMGlobalDnsConfig *config)
|
|||
for (i = 0; i < nm_global_dns_config_get_num_domains (config); i++) {
|
||||
NMGlobalDnsDomain *domain = nm_global_dns_config_get_domain (config, i);
|
||||
const char *const *servers = nm_global_dns_domain_get_servers (domain);
|
||||
const char *name = nm_global_dns_domain_get_name (domain);
|
||||
|
||||
g_return_if_fail (name);
|
||||
|
||||
for (j = 0; servers && servers[j]; j++) {
|
||||
if (!strcmp (servers[j], "*"))
|
||||
if (!strcmp (name, "*"))
|
||||
g_string_append_printf (str, "server=%s\n", servers[j]);
|
||||
else {
|
||||
g_string_append_printf (str, "server=/%s/%s\n",
|
||||
nm_global_dns_domain_get_name (domain),
|
||||
servers[j]);
|
||||
}
|
||||
else
|
||||
g_string_append_printf (str, "server=/%s/%s\n", name, servers[j]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue