summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2022-10-13 17:06:19 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2022-10-14 10:48:41 +0200
commit6ac62a746f18b630ec6c6a7a3e90c2a7b98a2edf (patch)
tree9a713a8b9490442e6dd602e9498e1eb5e2971482
parentad8a6a59af1f9f9c74799b0b359622f75d2e828a (diff)
downloadNetworkManager-6ac62a746f18b630ec6c6a7a3e90c2a7b98a2edf.tar.gz
dns: sort the ip-data list when a new element is added
In nm_dns_manager_set_ip_config() we try to avoid calling update_dns() unless something changes, because updating DNS is expensive and can trigger other actions such as a new hostname resolution. When we add a new ip_data, even if the new element is equivalent to the old one that was removed, we need to sort the list again. Fixes: ce0a36d20fa6 ('dns: better track l3cd changes') https://bugzilla.redhat.com/show_bug.cgi?id=2098574 (cherry picked from commit 3cc7801779ed05d13c3e2422f11ddb365bc37242) (cherry picked from commit db4c55c8d32179bcaf222029469802d96312413b)
-rw-r--r--src/core/dns/nm-dns-manager.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index bdf6fe6580..9c53520b61 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -1951,6 +1951,7 @@ nm_dns_manager_set_ip_config(NMDnsManager *self,
if (!ip_data) {
ip_data = _dns_config_ip_data_new(data, addr_family, source_tag, l3cd, ip_config_type);
+ priv->ip_data_lst_need_sort = TRUE;
if (!any_removed) {
/* `any_removed` tracks whether we deleted any ip_data. If that happened,
* we already compared the old and new l3cds and set `changed` accordingly.