diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-07 22:27:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-07 22:27:13 +0000 |
commit | e78d610f4f9bb6f8f04d585309c8e0befda4918e (patch) | |
tree | 8f9243ca7b4d2070933283166915aa2ed7eceba5 /src/dv | |
parent | b8a6d40874c4ea36bd96d7f46ebc9c3e219f6ee5 (diff) | |
download | gnunet-e78d610f4f9bb6f8f04d585309c8e0befda4918e.tar.gz gnunet-e78d610f4f9bb6f8f04d585309c8e0befda4918e.zip |
-fix #3152
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index c7d6a6f40..e15d30ead 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -705,6 +705,7 @@ get_consensus_slot (uint32_t distance) | |||
705 | struct ConsensusSet *cs; | 705 | struct ConsensusSet *cs; |
706 | unsigned int i; | 706 | unsigned int i; |
707 | 707 | ||
708 | GNUNET_assert (distance < DEFAULT_FISHEYE_DEPTH - 1); | ||
708 | cs = &consensi[distance]; | 709 | cs = &consensi[distance]; |
709 | i = 0; | 710 | i = 0; |
710 | while ( (i < cs->array_length) && | 711 | while ( (i < cs->array_length) && |
@@ -731,6 +732,7 @@ allocate_route (struct Route *route, | |||
731 | { | 732 | { |
732 | unsigned int i; | 733 | unsigned int i; |
733 | 734 | ||
735 | GNUNET_assert (distance < DEFAULT_FISHEYE_DEPTH - 1); | ||
734 | i = get_consensus_slot (distance); | 736 | i = get_consensus_slot (distance); |
735 | route->set_offset = i; | 737 | route->set_offset = i; |
736 | consensi[distance].targets[i] = route; | 738 | consensi[distance].targets[i] = route; |
@@ -1033,6 +1035,8 @@ check_possible_route (void *cls, | |||
1033 | } | 1035 | } |
1034 | return GNUNET_YES; /* got a route to this target already */ | 1036 | return GNUNET_YES; /* got a route to this target already */ |
1035 | } | 1037 | } |
1038 | if (ntohl (target->distance) >= DEFAULT_FISHEYE_DEPTH - 1) | ||
1039 | return GNUNET_YES; /* distance is too large to be interesting */ | ||
1036 | route = GNUNET_new (struct Route); | 1040 | route = GNUNET_new (struct Route); |
1037 | route->next_hop = neighbor; | 1041 | route->next_hop = neighbor; |
1038 | route->target.distance = htonl (ntohl (target->distance) + 1); | 1042 | route->target.distance = htonl (ntohl (target->distance) + 1); |