From c5682f736f7eee30a5c731d6b5ce8c0742b11e41 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 6 Nov 2020 23:37:16 +0100 Subject: [PATCH] dns: sd-resolved: fix hash table initialization The hash table was not initialized if there was no D-Bus connection at the time of object creation. Fixes: f70ee67058c9 ('dns: sd-resolved: reset interface configuration on deactivation') https://bugzilla.redhat.com/show_bug.cgi?id=1894839 (cherry picked from commit d6457902d127f2a29be4d12fe5b9ae94e3106b57) (cherry picked from commit cd58512ba362167b8ed3399c5677d60f917af144) (cherry picked from commit 8c7049b4f0b86e7d89ace41a7e919d2ebe573f91) --- src/dns/nm-dns-systemd-resolved.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dns/nm-dns-systemd-resolved.c b/src/dns/nm-dns-systemd-resolved.c index f7a7b6c935..621a269cca 100644 --- a/src/dns/nm-dns-systemd-resolved.c +++ b/src/dns/nm-dns-systemd-resolved.c @@ -521,6 +521,7 @@ nm_dns_systemd_resolved_init (NMDnsSystemdResolved *self) NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self); c_list_init (&priv->request_queue_lst_head); + priv->dirty_interfaces = g_hash_table_new (nm_direct_hash, NULL); priv->dbus_connection = nm_g_object_ref (NM_MAIN_DBUS_CONNECTION_GET); if (!priv->dbus_connection) { @@ -540,8 +541,6 @@ nm_dns_systemd_resolved_init (NMDnsSystemdResolved *self) priv->cancellable, get_name_owner_cb, self); - - priv->dirty_interfaces = g_hash_table_new (nm_direct_hash, NULL); } NMDnsPlugin *