diff options
author | Thomas Haller <thaller@redhat.com> | 2017-04-23 20:31:31 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-05-11 18:57:24 +0200 |
commit | 1666d9f2862247e6c18d3543800f40f433235e88 (patch) | |
tree | 8a02b13beeb072572667c09af00657ee06c65b68 | |
parent | 0e0ce3fdc435f73141023902aee32745e2d54bbb (diff) | |
download | NetworkManager-th/async-bgo781643.tar.gz |
policy: log policy's orig_hostnameth/async-bgo781643
-rw-r--r-- | src/dns/nm-dns-manager.c | 1 | ||||
-rw-r--r-- | src/nm-policy.c | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c index 1f6c2eede4..cc9be29e7f 100644 --- a/src/dns/nm-dns-manager.c +++ b/src/dns/nm-dns-manager.c @@ -1435,6 +1435,7 @@ nm_dns_manager_set_initial_hostname (NMDnsManager *self, { NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); + g_free (priv->hostname); priv->hostname = g_strdup (hostname); } diff --git a/src/nm-policy.c b/src/nm-policy.c index 3b27b2063d..2d17bf3af0 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -629,13 +629,14 @@ update_system_hostname (NMPolicy *self, NMDevice *best4, NMDevice *best6, const temp_hostname); priv->dhcp_hostname = FALSE; + if (!nm_utils_is_specific_hostname (temp_hostname)) + nm_clear_g_free (&temp_hostname); if (!nm_streq0 (temp_hostname, priv->orig_hostname)) { /* Update original (fallback) hostname */ g_free (priv->orig_hostname); - if (nm_utils_is_specific_hostname (temp_hostname)) - priv->orig_hostname = g_steal_pointer (&temp_hostname); - else - priv->orig_hostname = NULL; + priv->orig_hostname = g_steal_pointer (&temp_hostname); + _LOGT (LOGD_DNS, "hostname-original: update to %s%s%s", + NM_PRINT_FMT_QUOTE_STRING (priv->orig_hostname)); } } @@ -2347,6 +2348,8 @@ constructed (GObject *object) if (nm_utils_is_specific_hostname (hostname)) priv->orig_hostname = g_strdup (hostname); } + _LOGT (LOGD_DNS, "hostname-original: set to %s%s%s", + NM_PRINT_FMT_QUOTE_STRING (priv->orig_hostname)); priv->firewall_manager = g_object_ref (nm_firewall_manager_get ()); g_signal_connect (priv->firewall_manager, NM_FIREWALL_MANAGER_STATE_CHANGED, |