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-13 17:24:58 +0200
commit4d1ecd8d6dbe6666f9005950a95a6ba8321e653c (patch)
tree3aca02ae32901cb95338e3a3ff7e9173b8cfd772
parent2a0bbd788bf00b25b1fe0154e79730e27283132a (diff)
downloadNetworkManager-4d1ecd8d6dbe6666f9005950a95a6ba8321e653c.tar.gz
dns: add comment explaining the purpose of `any_removed`
-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 7b44e090c6..70a6d5c190 100644
--- a/src/core/dns/nm-dns-manager.c
+++ b/src/core/dns/nm-dns-manager.c
@@ -2039,8 +2039,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;