2
src/dns-manager/nm-dns-dnsmasq.c | 8 ++++----
3
src/dns-manager/nm-dns-manager.c | 6 +++---
4
src/org.freedesktop.NetworkManager.conf | 10 ++++++++++
5
3 files changed, 17 insertions(+), 7 deletions(-)
7
Index: b/src/dns-manager/nm-dns-dnsmasq.c
8
===================================================================
9
--- a/src/dns-manager/nm-dns-dnsmasq.c
10
+++ b/src/dns-manager/nm-dns-dnsmasq.c
11
@@ -49,7 +49,7 @@ G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsm
12
#define CONFFILE NMRUNDIR "/dnsmasq.conf"
13
#define CONFDIR NMCONFDIR "/dnsmasq.d"
15
-#define DNSMASQ_DBUS_SERVICE "uk.org.thekelleys.dnsmasq"
16
+#define DNSMASQ_DBUS_SERVICE "org.freedesktop.NetworkManager.dnsmasq"
17
#define DNSMASQ_DBUS_PATH "/uk/org/thekelleys/dnsmasq"
18
#define DNSMASQ_DBUS_INTERFACE "uk.org.thekelleys.dnsmasq"
20
@@ -286,11 +286,11 @@ start_dnsmasq (NMDnsDnsmasq *self)
21
argv[idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */
22
argv[idx++] = "--bind-interfaces";
23
argv[idx++] = "--pid-file=" PIDFILE;
24
- argv[idx++] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */
25
+ argv[idx++] = "--listen-address=127.0.1.1"; /* Should work for both 4 and 6 */
26
argv[idx++] = "--conf-file=" CONFFILE;
27
argv[idx++] = "--cache-size=0";
28
argv[idx++] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */
29
- argv[idx++] = "--enable-dbus";
30
+ argv[idx++] = "--enable-dbus=" DNSMASQ_DBUS_SERVICE;
32
/* dnsmasq exits if the conf dir is not present */
33
if (g_file_test (CONFDIR, G_FILE_TEST_IS_DIR))
34
@@ -411,7 +411,7 @@ update (NMDnsPlugin *plugin,
36
/* If all the configs lists are empty, there is just nothing to be caching --
37
* we cleared up the dnsmasq cache; but we should also fail the update, so
38
- * that we don't write 127.0.0.1 to resolv.conf.
39
+ * that we don't write 127.0.1.1 to resolv.conf.
41
if (((vpn_configs && g_slist_length (vpn_configs) < 1) || !vpn_configs) &&
42
((dev_configs && g_slist_length (dev_configs) < 1) || !dev_configs) &&
43
Index: b/src/dns-manager/nm-dns-manager.c
44
===================================================================
45
--- a/src/dns-manager/nm-dns-manager.c
46
+++ b/src/dns-manager/nm-dns-manager.c
47
@@ -741,7 +741,7 @@ update_dns (NMDnsManager *self,
48
g_slist_free (dev_configs);
49
g_slist_free (other_configs);
51
- /* If caching was successful, we only send 127.0.0.1 to /etc/resolv.conf
52
+ /* If caching was successful, we only send 127.0.1.1 to /etc/resolv.conf
53
* to ensure that the glibc resolver doesn't try to round-robin nameservers,
54
* but only uses the local caching nameserver.
56
@@ -749,7 +749,7 @@ update_dns (NMDnsManager *self,
58
g_strfreev (nameservers);
59
nameservers = g_new0 (char*, 2);
60
- nameservers[0] = g_strdup ("127.0.0.1");
61
+ nameservers[0] = g_strdup ("127.0.1.1");
64
#ifdef RESOLVCONF_PATH
65
@@ -1162,7 +1162,7 @@ dispose (GObject *object)
66
g_clear_object (&priv->plugin);
68
/* If we're quitting, leave a valid resolv.conf in place, not one
69
- * pointing to 127.0.0.1 if any plugins were active. Thus update
70
+ * pointing to 127.0.1.1 if any plugins were active. Thus update
71
* DNS after disposing of all plugins. But if we haven't done any
72
* DNS updates yet, there's no reason to touch resolv.conf on shutdown.
74
Index: b/src/org.freedesktop.NetworkManager.conf
75
===================================================================
76
--- a/src/org.freedesktop.NetworkManager.conf
77
+++ b/src/org.freedesktop.NetworkManager.conf
79
<allow send_destination="org.freedesktop.NetworkManager.vpnc"/>
80
<allow send_destination="org.freedesktop.NetworkManager.ssh"/>
81
<allow send_destination="org.freedesktop.NetworkManager.iodine"/>
83
+ <!-- Allow the custom name for the dnsmasq instance spawned by NM
84
+ from the dns dnsmasq plugin to own it's dbus name, and for
85
+ messages to be sent to it.
87
+ <allow own="org.freedesktop.NetworkManager.dnsmasq"/>
88
+ <allow send_destination="org.freedesktop.NetworkManager.dnsmasq"/>
90
<policy user="whoopsie">
91
<allow send_destination="org.freedesktop.NetworkManager"/>
93
<deny send_interface="org.freedesktop.NetworkManager.Settings" send_member="ReloadConnections"/>
94
<deny send_interface="org.freedesktop.NetworkManager.VPN.Plugin"/>
95
<deny send_interface="org.freedesktop.NetworkManager.PPP"/>
97
+ <deny own="org.freedesktop.NetworkManager.dnsmasq"/>
98
+ <deny send_destination="org.freedesktop.NetworkManager.dnsmasq"/>