From 0bc4bfeedf3972e880a059fab5d0b107205b890c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 25 Oct 2011 13:28:36 +0000 Subject: [PATCH] ob1 --- src/dht/gnunet-service-dht_neighbours.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 9362d28c5..02124b488 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -1022,7 +1022,7 @@ select_peer (const GNUNET_HashCode *key, /* greedy selection (closest peer that is not in bloomfilter) */ smallest_distance = UINT_MAX; chosen = NULL; - for (bc = 0; bc < closest_bucket; bc++) + for (bc = 0; bc <= closest_bucket; bc++) { pos = k_buckets[bc].head; count = 0; @@ -1065,7 +1065,7 @@ select_peer (const GNUNET_HashCode *key, /* select "random" peer */ /* count number of peers that are available and not filtered */ count = 0; - for (bc = 0; bc < closest_bucket; bc++) + for (bc = 0; bc <= closest_bucket; bc++) { pos = k_buckets[bc].head; while ((pos != NULL) && (count < bucket_size)) @@ -1100,7 +1100,7 @@ select_peer (const GNUNET_HashCode *key, /* Now actually choose a peer */ selected = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, count); count = 0; - for (bc = 0; bc < closest_bucket; bc++) + for (bc = 0; bc <= closest_bucket; bc++) { pos = k_buckets[bc].head; while ((pos != NULL) && (count < bucket_size)) -- 2.25.1