From 81cb867e9fbde39d70154f832c25edaa2d0afc28 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 Jan 2011 10:24:23 -0600 Subject: [PATCH] policy: don't update hostname on exit It's a leftover from when /etc/hosts got fixed up, and since that isn't being done anymore, there's no reason to touch the hostname on exit. It will already have been updated in response to device deactivation (if the hostname was DHCP-provided for example) so it shouldn't need to be touched on exit. This also removes a potential crash on shutdown when systemd or another startup manager kills D-Bus before NetworkManager, which made the dispatcher code angry (which got executed on hostname change). --- src/nm-policy.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index b5c212929b..53557039e5 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1222,15 +1222,6 @@ nm_policy_destroy (NMPolicy *policy) } g_slist_free (policy->dev_signal_ids); - /* Rewrite /etc/hosts on exit to ensure we don't leave stale IP addresses - * lying around. FIXME: this will take out a valid IP address of an - * ethernet device we're leaving active (ie, a connection we can "assume" - * when NM starts again). - */ - policy->default_device4 = NULL; - policy->default_device6 = NULL; - update_system_hostname (policy, NULL, NULL); - g_free (policy->orig_hostname); g_free (policy->cur_hostname);