summary refs log tree commit diff
path: root/src/dns
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-09-08 17:44:06 +0200
committerMichael Biebl <biebl@debian.org>2018-09-08 17:44:06 +0200
commit8f7a3cbbdd0c0a48277c341dd3a8ec8743ae9735 (patch)
tree4353551fcb59cc822c3cadf2f4888f70601e8fbf /src/dns
parentcaf1db9d6fbc056cc6c76a24574890f6c7895f3d (diff)
New upstream version 1.13.90 upstream/1.13.90
Diffstat (limited to 'src/dns')
-rw-r--r--src/dns/nm-dns-dnsmasq.c2
-rw-r--r--src/dns/nm-dns-manager.c10
-rw-r--r--src/dns/nm-dns-plugin.c4
-rw-r--r--src/dns/nm-dns-plugin.h2
-rw-r--r--src/dns/nm-dns-systemd-resolved.c28
5 files changed, 34 insertions, 12 deletions
diff --git a/src/dns/nm-dns-dnsmasq.c b/src/dns/nm-dns-dnsmasq.c
index b5b93280..90a08d59 100644
--- a/src/dns/nm-dns-dnsmasq.c
+++ b/src/dns/nm-dns-dnsmasq.c
@@ -407,7 +407,7 @@ update (NMDnsPlugin *plugin,
 /*****************************************************************************/
 
 static void
-child_quit (NMDnsPlugin *plugin, gint status)
+child_quit (NMDnsPlugin *plugin, int status)
 {
 	NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin);
 	NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self);
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c
index a29fd81f..6a59b41c 100644
--- a/src/dns/nm-dns-manager.c
+++ b/src/dns/nm-dns-manager.c
@@ -310,7 +310,7 @@ _config_data_free (NMDnsConfigData *data)
 	g_slice_free (NMDnsConfigData, data);
 }
 
-static gint
+static int
 _ip_config_data_cmp (const NMDnsIPConfigData *a, const NMDnsIPConfigData *b)
 {
 	int a_prio, b_prio;
@@ -333,7 +333,7 @@ _ip_config_data_cmp (const NMDnsIPConfigData *a, const NMDnsIPConfigData *b)
 	return 0;
 }
 
-static gint
+static int
 _ip_config_lst_cmp (const CList *a,
                     const CList *b,
                     const void *user_data)
@@ -482,7 +482,7 @@ merge_one_ip_config (NMResolvConfData *rc,
 }
 
 static GPid
-run_netconfig (NMDnsManager *self, GError **error, gint *stdin_fd)
+run_netconfig (NMDnsManager *self, GError **error, int *stdin_fd)
 {
 	char *argv[5];
 	gs_free char *tmp = NULL;
@@ -533,7 +533,7 @@ dispatch_netconfig (NMDnsManager *self,
                     GError **error)
 {
 	GPid pid;
-	gint fd;
+	int fd;
 	int status;
 	gssize l;
 	nm_auto_free_gstring GString *str = NULL;
@@ -970,6 +970,8 @@ compute_hash (NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer
 	else {
 		const CList *head;
 
+		/* FIXME(ip-config-checksum): this relies on the fact that an IP
+		 * configuration without DNS parameters gives a zero checksum. */
 		head = _ip_config_lst_head (self);
 		c_list_for_each_entry (ip_data, head, ip_config_lst)
 			nm_ip_config_hash (ip_data->ip_config, sum, TRUE);
diff --git a/src/dns/nm-dns-plugin.c b/src/dns/nm-dns-plugin.c
index d9400e3e..48f04b00 100644
--- a/src/dns/nm-dns-plugin.c
+++ b/src/dns/nm-dns-plugin.c
@@ -124,7 +124,7 @@ _clear_pidfile (NMDnsPlugin *self)
 static void
 kill_existing (const char *progname, const char *pidfile, const char *kill_match)
 {
-	glong pid;
+	long pid;
 	gs_free char *contents = NULL;
 	gs_free char *cmdline_contents = NULL;
 	guint64 start_time;
@@ -167,7 +167,7 @@ out:
 }
 
 static void
-watch_cb (GPid pid, gint status, gpointer user_data)
+watch_cb (GPid pid, int status, gpointer user_data)
 {
 	NMDnsPlugin *self = NM_DNS_PLUGIN (user_data);
 	NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self);
diff --git a/src/dns/nm-dns-plugin.h b/src/dns/nm-dns-plugin.h
index 80b77d95..8a55921d 100644
--- a/src/dns/nm-dns-plugin.h
+++ b/src/dns/nm-dns-plugin.h
@@ -70,7 +70,7 @@ typedef struct {
 	 * by NMDnsManager.  If the subclass decides the exit status (as returned
 	 * by waitpid(2)) is fatal it should then emit the 'failed' signal.
 	 */
-	void (*child_quit) (NMDnsPlugin *self, gint status);
+	void (*child_quit) (NMDnsPlugin *self, int status);
 } NMDnsPluginClass;
 
 GType nm_dns_plugin_get_type (void);
diff --git a/src/dns/nm-dns-systemd-resolved.c b/src/dns/nm-dns-systemd-resolved.c
index 1a73aae1..544f19c1 100644
--- a/src/dns/nm-dns-systemd-resolved.c
+++ b/src/dns/nm-dns-systemd-resolved.c
@@ -65,7 +65,6 @@ typedef struct {
 	GDBusProxy *resolve;
 	GCancellable *init_cancellable;
 	GCancellable *update_cancellable;
-	GCancellable *mdns_cancellable;
 	CList request_queue_lst_head;
 } NMDnsSystemdResolvedPrivate;
 
@@ -192,7 +191,8 @@ prepare_one_interface (NMDnsSystemdResolved *self, InterfaceConfig *ic)
 	GVariantBuilder dns, domains;
 	NMCListElem *elem;
 	NMSettingConnectionMdns mdns = NM_SETTING_CONNECTION_MDNS_DEFAULT;
-	const char *mdns_arg = NULL;
+	NMSettingConnectionLlmnr llmnr = NM_SETTING_CONNECTION_LLMNR_DEFAULT;
+	const char *mdns_arg = NULL, *llmnr_arg = NULL;
 
 	g_variant_builder_init (&dns, G_VARIANT_TYPE ("(ia(iay))"));
 	g_variant_builder_add (&dns, "i", ic->ifindex);
@@ -208,8 +208,10 @@ prepare_one_interface (NMDnsSystemdResolved *self, InterfaceConfig *ic)
 
 		update_add_ip_config (self, &dns, &domains, data);
 
-		if (NM_IS_IP4_CONFIG (ip_config))
+		if (NM_IS_IP4_CONFIG (ip_config)) {
 			mdns = NM_MAX (mdns, nm_ip4_config_mdns_get (NM_IP4_CONFIG (ip_config)));
+			llmnr = NM_MAX (llmnr, nm_ip4_config_llmnr_get (NM_IP4_CONFIG (ip_config)));
+		}
 	}
 
 	g_variant_builder_close (&dns);
@@ -231,6 +233,22 @@ prepare_one_interface (NMDnsSystemdResolved *self, InterfaceConfig *ic)
 	}
 	nm_assert (mdns_arg);
 
+	switch (llmnr) {
+	case NM_SETTING_CONNECTION_LLMNR_NO:
+		llmnr_arg = "no";
+		break;
+	case NM_SETTING_CONNECTION_LLMNR_RESOLVE:
+		llmnr_arg = "resolve";
+		break;
+	case NM_SETTING_CONNECTION_LLMNR_YES:
+		llmnr_arg = "yes";
+		break;
+	case NM_SETTING_CONNECTION_LLMNR_DEFAULT:
+		llmnr_arg = "";
+		break;
+	}
+	nm_assert (llmnr_arg);
+
 	_request_item_append (&priv->request_queue_lst_head,
 	                      "SetLinkDNS",
 	                      g_variant_builder_end (&dns));
@@ -240,6 +258,9 @@ prepare_one_interface (NMDnsSystemdResolved *self, InterfaceConfig *ic)
 	_request_item_append (&priv->request_queue_lst_head,
 	                      "SetLinkMulticastDNS",
 	                      g_variant_new ("(is)", ic->ifindex, mdns_arg ?: ""));
+	_request_item_append (&priv->request_queue_lst_head,
+	                      "SetLinkLLMNR",
+	                      g_variant_new ("(is)", ic->ifindex, llmnr_arg ?: ""));
 }
 
 static void
@@ -410,7 +431,6 @@ dispose (GObject *object)
 	g_clear_object (&priv->resolve);
 	nm_clear_g_cancellable (&priv->init_cancellable);
 	nm_clear_g_cancellable (&priv->update_cancellable);
-	nm_clear_g_cancellable (&priv->mdns_cancellable);
 
 	G_OBJECT_CLASS (nm_dns_systemd_resolved_parent_class)->dispose (object);
 }