summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-10-17 19:44:27 +0200
committerThomas Haller <thaller@redhat.com>2017-10-18 11:43:34 +0200
commit5e48425480e298b77ab41b1fe3764ea6fd82d4f1 (patch)
treecea2762e692017b25dac1d06586b29d934305f6f
parent1218cea77cb86a5e56fe8e7a910d76d901d8470c (diff)
downloadNetworkManager-th/hash.tar.gz
platform: don't hash the compare type in nm_platform_ip4_route_hash_update()th/hash
We don't need this extra distinguisher. It makes no sense to ever compare two routes with a different compare-type. Also, the number of fields that is hashed already differs between each compare type. If we have a good hashing algorithm, this already suffices that the hash value looks largely different.
-rw-r--r--src/platform/nm-platform.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 56c36c2630..1773b15ad2 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -5511,7 +5511,6 @@ nm_platform_ip4_route_hash_update (const NMPlatformIP4Route *obj, NMPlatformIPRo
switch (cmp_type) {
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_WEAK_ID:
nm_hash_update_vals (h,
- cmp_type,
nm_platform_route_table_uncoerce (obj->table_coerced, TRUE),
nm_utils_ip4_address_clear_host_address (obj->network, obj->plen),
obj->plen,
@@ -5520,7 +5519,6 @@ nm_platform_ip4_route_hash_update (const NMPlatformIP4Route *obj, NMPlatformIPRo
break;
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID:
nm_hash_update_vals (h,
- cmp_type,
nm_platform_route_table_uncoerce (obj->table_coerced, TRUE),
nm_utils_ip4_address_clear_host_address (obj->network, obj->plen),
obj->plen,
@@ -5547,7 +5545,6 @@ nm_platform_ip4_route_hash_update (const NMPlatformIP4Route *obj, NMPlatformIPRo
break;
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_SEMANTICALLY:
nm_hash_update_vals (h,
- cmp_type,
nm_platform_route_table_uncoerce (obj->table_coerced, TRUE),
obj->ifindex,
nm_utils_ip4_address_clear_host_address (obj->network, obj->plen),
@@ -5574,7 +5571,6 @@ nm_platform_ip4_route_hash_update (const NMPlatformIP4Route *obj, NMPlatformIPRo
break;
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL:
nm_hash_update_vals (h,
- cmp_type,
obj->table_coerced,
obj->ifindex,
obj->network,
@@ -5687,7 +5683,6 @@ nm_platform_ip6_route_hash_update (const NMPlatformIP6Route *obj, NMPlatformIPRo
switch (cmp_type) {
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_WEAK_ID:
nm_hash_update_vals (h,
- cmp_type,
nm_platform_route_table_uncoerce (obj->table_coerced, TRUE),
*nm_utils_ip6_address_clear_host_address (&a1, &obj->network, obj->plen),
obj->plen,
@@ -5697,7 +5692,6 @@ nm_platform_ip6_route_hash_update (const NMPlatformIP6Route *obj, NMPlatformIPRo
break;
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID:
nm_hash_update_vals (h,
- cmp_type,
nm_platform_route_table_uncoerce (obj->table_coerced, TRUE),
*nm_utils_ip6_address_clear_host_address (&a1, &obj->network, obj->plen),
obj->plen,
@@ -5710,7 +5704,6 @@ nm_platform_ip6_route_hash_update (const NMPlatformIP6Route *obj, NMPlatformIPRo
break;
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_SEMANTICALLY:
nm_hash_update_vals (h,
- cmp_type,
nm_platform_route_table_uncoerce (obj->table_coerced, TRUE),
obj->ifindex,
*nm_utils_ip6_address_clear_host_address (&a1, &obj->network, obj->plen),
@@ -5738,7 +5731,6 @@ nm_platform_ip6_route_hash_update (const NMPlatformIP6Route *obj, NMPlatformIPRo
break;
case NM_PLATFORM_IP_ROUTE_CMP_TYPE_FULL:
nm_hash_update_vals (h,
- cmp_type,
obj->table_coerced,
obj->ifindex,
obj->network,