summaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-04-06 14:37:07 +0200
committerChristian Grothoff <christian@grothoff.org>2019-04-06 14:37:07 +0200
commitc57caa206c761424b73e900978edff0a1b8fca50 (patch)
tree66641306c9a1d196dfe9f82c863bada50fb86187 /src/rps
parentc0d08bbdeed4523cf89bf55b64ce2c16476c3e26 (diff)
downloadgnunet-c57caa206c761424b73e900978edff0a1b8fca50.tar.gz
gnunet-c57caa206c761424b73e900978edff0a1b8fca50.zip
introduce GNUNET_memcmp() and GNUNET_is_zero()
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c6
-rw-r--r--src/rps/gnunet-service-rps_sampler_elem.c2
-rw-r--r--src/rps/rps-sampler_common.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 1871ef006..f6fe17589 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2161,7 +2161,7 @@ rem_from_list (struct GNUNET_PeerIdentity **peer_list,
2161 2161
2162 for ( i = 0 ; i < *list_size ; i++ ) 2162 for ( i = 0 ; i < *list_size ; i++ )
2163 { 2163 {
2164 if (0 == GNUNET_CRYPTO_cmp_peer_identity (&tmp[i], peer)) 2164 if (0 == GNUNET_memcmp (&tmp[i], peer))
2165 { 2165 {
2166 if (i < *list_size -1) 2166 if (i < *list_size -1)
2167 { /* Not at the last entry -- shift peers left */ 2167 { /* Not at the last entry -- shift peers left */
@@ -2742,7 +2742,7 @@ clean_peer (struct Sub *sub,
2742 "Going to remove send channel to peer %s\n", 2742 "Going to remove send channel to peer %s\n",
2743 GNUNET_i2s (peer)); 2743 GNUNET_i2s (peer));
2744 #if ENABLE_MALICIOUS 2744 #if ENABLE_MALICIOUS
2745 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&attacked_peer, 2745 if (0 != GNUNET_memcmp (&attacked_peer,
2746 peer)) 2746 peer))
2747 (void) destroy_sending_channel (get_peer_ctx (sub->peer_map, 2747 (void) destroy_sending_channel (get_peer_ctx (sub->peer_map,
2748 peer)); 2748 peer));
@@ -3596,7 +3596,7 @@ handle_peer_pull_request (void *cls,
3596 3596
3597 else if (2 == mal_type) 3597 else if (2 == mal_type)
3598 { /* Try to partition network */ 3598 { /* Try to partition network */
3599 if (0 == GNUNET_CRYPTO_cmp_peer_identity (&attacked_peer, peer)) 3599 if (0 == GNUNET_memcmp (&attacked_peer, peer))
3600 { 3600 {
3601 send_pull_reply (peer_ctx, mal_peers, num_mal_peers); 3601 send_pull_reply (peer_ctx, mal_peers, num_mal_peers);
3602 } 3602 }
diff --git a/src/rps/gnunet-service-rps_sampler_elem.c b/src/rps/gnunet-service-rps_sampler_elem.c
index 737b7ee7f..9487c5f2e 100644
--- a/src/rps/gnunet-service-rps_sampler_elem.c
+++ b/src/rps/gnunet-service-rps_sampler_elem.c
@@ -111,7 +111,7 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *sampler_elem,
111 111
112 sampler_elem->num_peers++; 112 sampler_elem->num_peers++;
113 113
114 if (0 == GNUNET_CRYPTO_cmp_peer_identity (new_ID, &(sampler_elem->peer_id))) 114 if (0 == GNUNET_memcmp (new_ID, &(sampler_elem->peer_id)))
115 { 115 {
116 LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n", 116 LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n",
117 GNUNET_i2s (&(sampler_elem->peer_id))); 117 GNUNET_i2s (&(sampler_elem->peer_id)));
diff --git a/src/rps/rps-sampler_common.c b/src/rps/rps-sampler_common.c
index 3ed4ef989..f54de9014 100644
--- a/src/rps/rps-sampler_common.c
+++ b/src/rps/rps-sampler_common.c
@@ -286,7 +286,7 @@ RPS_sampler_reinitialise_by_value (struct RPS_Sampler *sampler,
286 286
287 for (i = 0; i < sampler->sampler_size; i++) 287 for (i = 0; i < sampler->sampler_size; i++)
288 { 288 {
289 if (0 == GNUNET_CRYPTO_cmp_peer_identity(id, 289 if (0 == GNUNET_memcmp(id,
290 &(sampler->sampler_elements[i]->peer_id)) ) 290 &(sampler->sampler_elements[i]->peer_id)) )
291 { 291 {
292 LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n"); 292 LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n");
@@ -314,7 +314,7 @@ RPS_sampler_count_id (struct RPS_Sampler *sampler,
314 count = 0; 314 count = 0;
315 for ( i = 0 ; i < sampler->sampler_size ; i++ ) 315 for ( i = 0 ; i < sampler->sampler_size ; i++ )
316 { 316 {
317 if ( 0 == GNUNET_CRYPTO_cmp_peer_identity (&sampler->sampler_elements[i]->peer_id, id) 317 if ( 0 == GNUNET_memcmp (&sampler->sampler_elements[i]->peer_id, id)
318 && EMPTY != sampler->sampler_elements[i]->is_empty) 318 && EMPTY != sampler->sampler_elements[i]->is_empty)
319 count++; 319 count++;
320 } 320 }