summaryrefslogtreecommitdiff
path: root/src/dns-manager
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-12-17 09:24:00 -0500
committerDan Winship <danw@gnome.org>2013-12-20 09:31:04 -0500
commit7d126290c4c82a9ae8ae59c1989ffd87b3f68730 (patch)
treeff13db693683b7be0c33b01c61ac5e2b221ac04b /src/dns-manager
parentea7eb5ab5ef008b416edd620ee10c9a26c39ae4f (diff)
downloadNetworkManager-7d126290c4c82a9ae8ae59c1989ffd87b3f68730.tar.gz
dns-manager: initialize hostname
NMPolicy only updates the NMDnsManager's hostname when it changes, which previously did not include at startup. Meaning if your hostname never changed, NMDnsManager would never learn it (and so would never add an appropriate "search" line to resolv.conf). Fix that.
Diffstat (limited to 'src/dns-manager')
-rw-r--r--src/dns-manager/nm-dns-manager.c11
-rw-r--r--src/dns-manager/nm-dns-manager.h6
2 files changed, 14 insertions, 3 deletions
diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index 4fab663103..fa166fa350 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -945,8 +945,17 @@ nm_dns_manager_remove_ip6_config (NMDnsManager *mgr, NMIP6Config *config)
}
void
+nm_dns_manager_set_initial_hostname (NMDnsManager *mgr,
+ const char *hostname)
+{
+ NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (mgr);
+
+ priv->hostname = g_strdup (hostname);
+}
+
+void
nm_dns_manager_set_hostname (NMDnsManager *mgr,
- const char *hostname)
+ const char *hostname)
{
NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (mgr);
GError *error = NULL;
diff --git a/src/dns-manager/nm-dns-manager.h b/src/dns-manager/nm-dns-manager.h
index 8e9a05dcda..b2bf2467c2 100644
--- a/src/dns-manager/nm-dns-manager.h
+++ b/src/dns-manager/nm-dns-manager.h
@@ -87,8 +87,10 @@ gboolean nm_dns_manager_add_ip6_config (NMDnsManager *mgr,
gboolean nm_dns_manager_remove_ip6_config (NMDnsManager *mgr, NMIP6Config *config);
-void nm_dns_manager_set_hostname (NMDnsManager *mgr,
- const char *hostname);
+void nm_dns_manager_set_initial_hostname (NMDnsManager *mgr,
+ const char *hostname);
+void nm_dns_manager_set_hostname (NMDnsManager *mgr,
+ const char *hostname);
/**
* NMDnsManagerResolvConfMode: