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 8ff1cbf38b)
This commit is contained in:
Beniamino Galvani 2025-02-12 20:54:51 +01:00
parent 5749633729
commit dc0ff10efb

View file

@ -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;
}