From dc0ff10efb2b9ea370fbe98d0a5720e9e9f15173 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 12 Feb 2025 20:54:51 +0100 Subject: [PATCH] dnsconfd: fix handling of the update-pending flag After every state change of the plugin there should be an invocation of _nm_dns_plugin_update_pending_maybe_changed() to re-evaluate whether we are waiting for an update. send_dnsconfd_update() doesn't change the state and so there is need to check again afterwards. (cherry picked from commit 8ff1cbf38b53950a6f12239326a1f41eca573915) --- src/core/dns/nm-dns-dnsconfd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/dns/nm-dns-dnsconfd.c b/src/core/dns/nm-dns-dnsconfd.c index b356c2f9ca..38b7558a12 100644 --- a/src/core/dns/nm-dns-dnsconfd.c +++ b/src/core/dns/nm-dns-dnsconfd.c @@ -61,7 +61,11 @@ G_DEFINE_TYPE(NMDnsDnsconfd, nm_dns_dnsconfd, NM_TYPE_DNS_PLUGIN) #define DNSCONFD_DBUS_SERVICE "com.redhat.dnsconfd" -typedef enum { CONNECTION_FAIL, CONNECTION_SUCCESS, CONNECTION_WAIT } ConnectionState; +typedef enum { + CONNECTION_FAIL, + CONNECTION_SUCCESS, + CONNECTION_WAIT, +} ConnectionState; /*****************************************************************************/ @@ -704,6 +708,8 @@ update(NMDnsPlugin *plugin, _LOGT("connected, waiting for update to finish"); } + _nm_dns_plugin_update_pending_maybe_changed(plugin); + if (all_connected == CONNECTION_FAIL) { nm_utils_error_set(error, NM_UTILS_ERROR_UNKNOWN, @@ -717,8 +723,6 @@ update(NMDnsPlugin *plugin, send_dnsconfd_update(self); - _nm_dns_plugin_update_pending_maybe_changed(NM_DNS_PLUGIN(self)); - return TRUE; }