core: fix detection of relevant changes in nm_ipX_config_replace()

The @relevant_changes output value must match the result of
!nm_ipX_config_equal(), so route metric and gateway must be taken into
account too.

Fixes: 935411e5c0
Fixes: cfd1851c00

https://bugzilla.redhat.com/show_bug.cgi?id=1471244
This commit is contained in:
Beniamino Galvani 2017-07-15 11:47:48 +02:00
parent 5aa22ed8c9
commit 8469d77e2b
2 changed files with 6 additions and 2 deletions

View file

@ -1313,7 +1313,9 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev
if (nm_platform_ip4_route_cmp (r_src, r_dst) != 0) {
are_equal = FALSE;
if (!nm_ip_config_obj_id_equal_ip4_route (r_src, r_dst)) {
if ( !nm_ip_config_obj_id_equal_ip4_route (r_src, r_dst)
|| r_src->gateway != r_dst->gateway
|| r_src->metric != r_dst->metric) {
has_relevant_changes = TRUE;
break;
}

View file

@ -1193,7 +1193,9 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev
if (nm_platform_ip6_route_cmp (r_src, r_dst) != 0) {
are_equal = FALSE;
if (!nm_ip_config_obj_id_equal_ip6_route (r_src, r_dst)) {
if ( !nm_ip_config_obj_id_equal_ip6_route (r_src, r_dst)
|| r_src->metric != r_dst->metric
|| !IN6_ARE_ADDR_EQUAL (&r_src->gateway, &r_dst->gateway)) {
has_relevant_changes = TRUE;
break;
}