diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-30 14:37:22 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-30 14:37:22 +0200 |
commit | 28938155e0133ae31c2f8b498d9b985160ca3ab4 (patch) | |
tree | fe61fb409830ae48a8ad88cdda2ab709914ff819 | |
parent | 04852d2877cf94d80d17d0e3f46eb1d286a0ecdb (diff) | |
download | NetworkManager-28938155e0133ae31c2f8b498d9b985160ca3ab4.tar.gz |
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
-rw-r--r-- | src/nm-ip4-config.c | 4 | ||||
-rw-r--r-- | 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 73c3cfd6fc..929b823622 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -1232,7 +1232,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 */ @@ -2220,8 +2220,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 706770c164..89975f8207 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -1172,7 +1172,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 @@ -1949,8 +1949,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)); } /** |