diff options
author | Thomas Haller <thaller@redhat.com> | 2017-09-11 21:41:57 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-09-13 08:17:31 +0200 |
commit | aee48dfd44c9e469303573fb6d02b0d0113658c5 (patch) | |
tree | 113de66f95922b2b9bce3757a0bdd01996a3c127 /src/nm-ip6-config.c | |
parent | e730ae7600854d159667d972717e2f0a7639ac42 (diff) | |
download | NetworkManager-aee48dfd44c9e469303573fb6d02b0d0113658c5.tar.gz |
core: adjust route equality for NMIP4Config/NMIP6Config to what kernel does
For kernel, route ID compare identical according to NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID.
Well, mostly. In practice, NM ignores several route properties that
kernel considers part of the ID too. This leaves the possibility that
kernel allows addition of two routes that compare idential for
NetworkManager.
Anyway, NMIP4Config/NMIP6Config should use the same equality as platform
cache. Otherwise, there is the odd situation that ip-config merges routes
that are treated as different by kernel.
For IP addresses the ID operator already corresponded to what kernel
does. There is no change for addresses.
Note that NMSettingIPConfig also uses a different algorithm for
comparing routes. But that doesn't really matter here, it it differed
before too.
Diffstat (limited to 'src/nm-ip6-config.c')
-rw-r--r-- | src/nm-ip6-config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 85883241d1..97d25d549c 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -1277,7 +1277,7 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev if (nm_platform_ip6_address_cmp (r_src, r_dst) != 0) { are_equal = FALSE; - if ( !nm_ip_config_obj_id_equal_ip6_address (r_src, r_dst) + if ( !IN6_ARE_ADDR_EQUAL (&r_src->address, &r_dst->address) || r_src->plen != r_dst->plen || !IN6_ARE_ADDR_EQUAL (nm_platform_ip6_address_get_peer (r_src), nm_platform_ip6_address_get_peer (r_dst))) { @@ -1325,7 +1325,8 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev if (nm_platform_ip6_route_cmp_full (r_src, r_dst) != 0) { are_equal = FALSE; - if ( !nm_ip_config_obj_id_equal_ip6_route (r_src, r_dst) + if ( r_src->plen != r_dst->plen + || !nm_utils_ip6_address_same_prefix (&r_src->network, &r_dst->network, r_src->plen) || r_src->metric != r_dst->metric || !IN6_ARE_ADDR_EQUAL (&r_src->gateway, &r_dst->gateway)) { has_relevant_changes = TRUE; |