summary refs log tree commit diff
path: root/src/dns/nm-dns-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns/nm-dns-manager.c')
-rw-r--r--src/dns/nm-dns-manager.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c
index c7c561c4..27c3e710 100644
--- a/src/dns/nm-dns-manager.c
+++ b/src/dns/nm-dns-manager.c
@@ -347,13 +347,20 @@ gboolean
 nm_dns_manager_has_systemd_resolved (NMDnsManager *self)
 {
 	NMDnsManagerPrivate *priv;
+	NMDnsSystemdResolved *plugin = NULL;
 
 	g_return_val_if_fail (NM_IS_DNS_MANAGER (self), FALSE);
 
 	priv = NM_DNS_MANAGER_GET_PRIVATE (self);
 
-	return    priv->sd_resolve_plugin
-	       || NM_IS_DNS_SYSTEMD_RESOLVED (priv->plugin);
+	if (priv->sd_resolve_plugin) {
+		nm_assert (!NM_IS_DNS_SYSTEMD_RESOLVED (priv->plugin));
+		plugin = NM_DNS_SYSTEMD_RESOLVED (priv->sd_resolve_plugin);
+	} else if (NM_IS_DNS_SYSTEMD_RESOLVED (priv->plugin))
+		plugin = NM_DNS_SYSTEMD_RESOLVED (priv->plugin);
+
+	return    plugin
+	       && nm_dns_systemd_resolved_is_running (plugin);
 }
 
 /*****************************************************************************/