summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2022-10-14 10:34:32 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2022-10-14 10:48:42 +0200
commit53eba18d60f7ff3cbf5e9ace9c3356f046568d7e (patch)
tree9a713a8b9490442e6dd602e9498e1eb5e2971482
parentc36bc32d834abb808a17e78913cf6a2f8cc082a8 (diff)
parent6ac62a746f18b630ec6c6a7a3e90c2a7b98a2edf (diff)
downloadNetworkManager-53eba18d60f7ff3cbf5e9ace9c3356f046568d7e.tar.gz
dns: merge branch 'bg/dns-sort'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1427 (cherry picked from commit e03b8fa44743d0ce91a849ea6f64cd99a0476e19) (cherry picked from commit 925ea8b24c44e6e2ff6cd54f59eeb92953289075)
-rw-r--r--src/core/dns/nm-dns-manager.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index 566f3d6626..9c53520b61 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -1951,8 +1951,15 @@ 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);
- if (!any_removed)
+ 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.
+ * Here we only need to set `changed` if we are adding a new ip_data without
+ * removing the old one.
+ */
changed = TRUE;
+ }
} else {
ip_data->ip_config_type = ip_config_type;
changed = TRUE;