From: Christian Grothoff Date: Tue, 25 Oct 2011 13:28:36 +0000 (+0000) Subject: ob1 X-Git-Tag: initial-import-from-subversion-38251~16264 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0bc4bfeedf3972e880a059fab5d0b107205b890c;p=oweals%2Fgnunet.git ob1 --- 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))