summaryrefslogtreecommitdiffstats
path: root/network/NetworkManager/patches/policy-don-t-update-hostname-on-exit.patch
blob: 720651619d5a0c2d95614899281fc608606d5899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 2ce6f29c2151af3f34976feda6964a21431cdb5f Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Sun, 2 Jan 2011 10:24:23 -0600
Subject: [PATCH 7/8] 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 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/src/nm-policy.c b/src/nm-policy.c
index 709be09..aed2f89 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -1195,15 +1195,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);
 
-- 
1.7.3.4