summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2022-10-13 17:23:15 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2022-10-14 10:53:34 +0200
commit79c08e8d5983644da9d5da09e8092bd3d976802a (patch)
treee968a61022d3e110fd8213f00fb0796a8a5961d5
parentcd855580f7c1c760a22789bd93e77f8602406a29 (diff)
downloadNetworkManager-79c08e8d5983644da9d5da09e8092bd3d976802a.tar.gz
dns: add comment explaining the purpose of `any_removed`
(cherry picked from commit 4d1ecd8d6dbe6666f9005950a95a6ba8321e653c) (cherry picked from commit 01b4040a7ad6f0b8c4aad1aabe4827841df2fe1e) (cherry picked from commit ad8a6a59af1f9f9c74799b0b359622f75d2e828a)
-rw-r--r--src/core/dns/nm-dns-manager.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/dns/nm-dns-manager.c b/src/core/dns/nm-dns-manager.c
index efbf847b71..f8d82ce4b1 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -1966,8 +1966,14 @@ 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)
+ 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;