From 89e9d3e8df1453c2f2917f8025c653e7ecdc790c Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 30 May 2016 14:37:22 +0200 Subject: [PATCH] core: don't include dns-priority in IP configuration hash The DNS priority property of a IP configuration determines how the configuration compares to others when deciding their order, but doesn't specify directly parameters to be applied. In other words, two configurations which differs only for the dns-priority should have the same hash as applying them will give the same result. Especially, when the DNS manager computes the hash of IP configurations, the ones without real configuration data (servers, domans, options...) should not change the hash value. Thus, exclude the property from the hash computation and dowgrade any modification to 'minor change'. Fixes: bfabfb05ae642112b7fde23da0d78689c2046745 Fixes: f09f5e1ec84b1e8b0e6231f72655f6446ae4646a (cherry picked from commit 28938155e0133ae31c2f8b498d9b985160ca3ab4) --- src/nm-ip4-config.c | 4 +--- src/nm-ip6-config.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index d02d62c462..0ae7d0d4f6 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -1210,7 +1210,7 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev /* DNS priority */ if (src_priv->dns_priority != dst_priv->dns_priority) { nm_ip4_config_set_dns_priority (dst, src_priv->dns_priority); - has_relevant_changes = TRUE; + has_minor_changes = TRUE; } /* mss */ @@ -2198,8 +2198,6 @@ nm_ip4_config_hash (const NMIP4Config *config, GChecksum *sum, gboolean dns_only s = nm_ip4_config_get_dns_option (config, i); g_checksum_update (sum, (const guint8 *) s, strlen (s)); } - - hash_u32 (sum, (guint32) nm_ip4_config_get_dns_priority (config)); } /** diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index ca0f9726e8..8644735726 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -1150,7 +1150,7 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev /* DNS priority */ if (src_priv->dns_priority != dst_priv->dns_priority) { nm_ip6_config_set_dns_priority (dst, src_priv->dns_priority); - has_relevant_changes = TRUE; + has_minor_changes = TRUE; } #if NM_MORE_ASSERTS @@ -1886,8 +1886,6 @@ nm_ip6_config_hash (const NMIP6Config *config, GChecksum *sum, gboolean dns_only s = nm_ip6_config_get_dns_option (config, i); g_checksum_update (sum, (const guint8 *) s, strlen (s)); } - - hash_u32 (sum, (guint32) nm_ip6_config_get_dns_priority (config)); } /**