2005-10-24 Dan Williams <dcbw@redhat.com>

Patch from Tor Krill <tor@krill.nu>
	* src/named-manager/nm-named-manager.c
		- Write more than just the first nameserver to /etc/resolv.conf
		- Write out valid /etc/resolv.conf on exit


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1067 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2005-10-24 14:49:26 +00:00
parent 23d422740b
commit f54406831c
2 changed files with 13 additions and 3 deletions

View File

@@ -301,7 +301,7 @@ compute_nameservers (NMNamedManager *mgr, NMIP4Config *config)
if (!str)
str = g_string_new ("");
addr.s_addr = nm_ip4_config_get_nameserver (config, 0);
addr.s_addr = nm_ip4_config_get_nameserver (config, i);
buf = g_malloc0 (ADDR_BUF_LEN);
inet_ntop (AF_INET, &addr, buf, ADDR_BUF_LEN);
@@ -354,6 +354,8 @@ rewrite_resolv_conf (NMNamedManager *mgr, NMIP4Config *config, GError **error)
char * searches = NULL;
FILE * f;
g_return_val_if_fail (config != NULL, FALSE);
if ((f = fopen (tmp_resolv_conf, "w")) == NULL)
goto lose;
@@ -704,8 +706,6 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr, NMIP4Config *config)
if (mgr->priv->use_named)
remove_ip4_config_from_named (mgr, config);
mgr->priv->configs = g_slist_remove (mgr->priv->configs, config);
nm_ip4_config_unref (config);
/* Clear out and reload configs since we may need a new
* default zone if the one we are removing was the old
@@ -723,6 +723,9 @@ nm_named_manager_remove_ip4_config (NMNamedManager *mgr, NMIP4Config *config)
g_error_free (error);
}
mgr->priv->configs = g_slist_remove (mgr->priv->configs, config);
nm_ip4_config_unref (config);
return TRUE;
}