diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c index 2a15bf5e46..6a59b41c7b 100644 --- a/src/dns/nm-dns-manager.c +++ b/src/dns/nm-dns-manager.c @@ -970,6 +970,8 @@ compute_hash (NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer else { const CList *head; + /* FIXME(ip-config-checksum): this relies on the fact that an IP + * configuration without DNS parameters gives a zero checksum. */ head = _ip_config_lst_head (self); c_list_for_each_entry (ip_data, head, ip_config_lst) nm_ip_config_hash (ip_data->ip_config, sum, TRUE); diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 5f1004130c..573c479a92 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -1885,8 +1885,15 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev has_relevant_changes = TRUE; } - dst_priv->mdns = src_priv->mdns; - dst_priv->llmnr = src_priv->llmnr; + if (src_priv->mdns != dst_priv->mdns) { + dst_priv->mdns = src_priv->mdns; + has_relevant_changes = TRUE; + } + + if (src_priv->llmnr != dst_priv->llmnr) { + dst_priv->llmnr = src_priv->llmnr; + has_relevant_changes = TRUE; + } /* DNS priority */ if (src_priv->dns_priority != dst_priv->dns_priority) { @@ -2877,6 +2884,7 @@ nm_ip4_config_hash (const NMIP4Config *self, GChecksum *sum, gboolean dns_only) NMDedupMultiIter ipconf_iter; const NMPlatformIP4Address *address; const NMPlatformIP4Route *route; + int val; g_return_if_fail (self); g_return_if_fail (sum); @@ -2923,6 +2931,25 @@ nm_ip4_config_hash (const NMIP4Config *self, GChecksum *sum, gboolean dns_only) s = nm_ip4_config_get_dns_option (self, i); g_checksum_update (sum, (const guint8 *) s, strlen (s)); } + + val = nm_ip4_config_mdns_get (self); + if (val != NM_SETTING_CONNECTION_MDNS_DEFAULT) + g_checksum_update (sum, (const guint8 *) &val, sizeof (val)); + + val = nm_ip4_config_llmnr_get (self); + if (val != NM_SETTING_CONNECTION_LLMNR_DEFAULT) + g_checksum_update (sum, (const guint8 *) &val, sizeof (val)); + + /* FIXME(ip-config-checksum): the DNS priority should be considered relevant + * and added into the checksum as well, but this can't be done right now + * because in the DNS manager we rely on the fact that an empty + * configuration (i.e. just created) has a zero checksum. This is needed to + * avoid rewriting resolv.conf when there is no change. + * + * The DNS priority initial value depends on the connection type (VPN or + * not), so it's a bit difficult to add it to checksum maintaining the + * assumption of checksum(empty)=0 + */ } /**