From f5127d7b147b4f48230caf7caa52a8f4e750a940 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 22 May 2026 14:36:10 +0200 Subject: [PATCH] ndisc: fix spurious DNS domains changed notification in clean_dns_domains() clean_dns_domains() uses "i != 0" as the condition to set the changed flag, but "i" is the total number of DNS domains (it equals rdata->dns_domains->len after the loop). The correct condition is "i != j", which is true only when some domains actually expired. Without this fix, any cleanup cycle with at least one DNS domain triggers a spurious NM_NDISC_CONFIG_DNS_DOMAINS change notification. Fixes: 4c2035347ec5 ('ndisc: track expiry of Router Advertisements in milliseconds') --- src/core/ndisc/nm-ndisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c index 9a0ede8af3..02d670f5c6 100644 --- a/src/core/ndisc/nm-ndisc.c +++ b/src/core/ndisc/nm-ndisc.c @@ -1695,7 +1695,7 @@ clean_dns_domains(NMNDisc *ndisc, gint64 now_msec, NMNDiscConfigMap *changed, gi j++; } - if (i != 0) { + if (i != j) { *changed |= NM_NDISC_CONFIG_DNS_DOMAINS; g_array_set_size(rdata->dns_domains, j); }