dns: fix handling of searches and domains in resolv.conf

Fix a few issues here:

- nm_utils_merge_ip4_config() didn't reset domains, which would cause domains
    to still be used even if the user elected to ignore DHCP-provided DNS
- nm_ip4_config_add_domain() and nm_ip4_config_add_search() didn't filter
    duplicates
- nm_ip4_config_reset_searches() leaked everything
- If the user had specified an appended search in the connection, that search
    would be added to the 'searches' field in resolv.conf, but any server
    returned domains in 'domain_name' would be ignored because at least one
    search existed.
This commit is contained in:
Dan Williams
2009-05-11 20:02:07 -04:00
parent fd4bdc5c54
commit b4767a5c1f
4 changed files with 103 additions and 48 deletions

View File

@@ -204,6 +204,7 @@ nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting)
if (nm_setting_ip4_config_get_ignore_auto_dns (setting)) {
nm_ip4_config_reset_nameservers (ip4_config);
nm_ip4_config_reset_domains (ip4_config);
nm_ip4_config_reset_searches (ip4_config);
}