diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-10 14:33:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-10 14:33:44 +0000 |
commit | 75cc53b243ab5054f621e22c1854e55ccff67206 (patch) | |
tree | 888cc40ac4b9598a3b1d4f5b874bdb8e7aa02117 /src/dv | |
parent | 119ea8602099651f3d147db0b74f1466bdcba541 (diff) | |
download | gnunet-75cc53b243ab5054f621e22c1854e55ccff67206.tar.gz gnunet-75cc53b243ab5054f621e22c1854e55ccff67206.zip |
-trying to fix #3189
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 24 | ||||
-rw-r--r-- | src/dv/test_transport_dv_data.conf | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 42ae9a4d6..140519ab9 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -803,8 +803,14 @@ build_set (void *cls) | |||
803 | struct DirectNeighbor *neighbor = cls; | 803 | struct DirectNeighbor *neighbor = cls; |
804 | struct GNUNET_SET_Element element; | 804 | struct GNUNET_SET_Element element; |
805 | struct Target *target; | 805 | struct Target *target; |
806 | struct Route *route; | ||
806 | 807 | ||
807 | target = NULL; | 808 | target = NULL; |
809 | /* skip over NULL entries */ | ||
810 | while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) && | ||
811 | (consensi[neighbor->consensus_insertion_distance].array_length > neighbor->consensus_insertion_offset) && | ||
812 | (NULL == consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset]) ) | ||
813 | neighbor->consensus_insertion_offset++; | ||
808 | while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) && | 814 | while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) && |
809 | (consensi[neighbor->consensus_insertion_distance].array_length == neighbor->consensus_insertion_offset) ) | 815 | (consensi[neighbor->consensus_insertion_distance].array_length == neighbor->consensus_insertion_offset) ) |
810 | { | 816 | { |
@@ -831,23 +837,17 @@ build_set (void *cls) | |||
831 | return; | 837 | return; |
832 | } | 838 | } |
833 | 839 | ||
834 | target = &consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset]->target; | 840 | route = consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset]; |
841 | GNUNET_assert (NULL != route); | ||
842 | target = &route->target; | ||
835 | element.size = sizeof (struct Target); | 843 | element.size = sizeof (struct Target); |
836 | element.type = htons (0); /* do we need this? */ | 844 | element.type = htons (0); /* do we need this? */ |
837 | element.data = target; | 845 | element.data = target; |
838 | 846 | ||
839 | /* Find next non-NULL entry */ | 847 | /* Find next non-NULL entry */ |
840 | neighbor->consensus_insertion_offset++; | 848 | neighbor->consensus_insertion_offset++; |
841 | /* skip over NULL entries */ | 849 | if ( (0 != memcmp (&target->peer, &my_identity, sizeof (my_identity))) && |
842 | while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) && | 850 | (0 != memcmp (&target->peer, &neighbor->peer, sizeof (neighbor->peer))) ) |
843 | (consensi[neighbor->consensus_insertion_distance].array_length > neighbor->consensus_insertion_offset) && | ||
844 | (NULL == consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset]) ) | ||
845 | { | ||
846 | neighbor->consensus_insertion_offset++; | ||
847 | } | ||
848 | |||
849 | if ( (0 != memcmp(&target->peer, &my_identity, sizeof (my_identity))) && | ||
850 | (0 != memcmp(&target->peer, &neighbor->peer, sizeof (neighbor->peer))) ) | ||
851 | { | 851 | { |
852 | /* Add target if it is not the neighbor or this peer */ | 852 | /* Add target if it is not the neighbor or this peer */ |
853 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 853 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -860,7 +860,7 @@ build_set (void *cls) | |||
860 | neighbor->consensus_elements++; | 860 | neighbor->consensus_elements++; |
861 | } | 861 | } |
862 | else | 862 | else |
863 | build_set(neighbor); | 863 | build_set (neighbor); |
864 | } | 864 | } |
865 | 865 | ||
866 | 866 | ||
diff --git a/src/dv/test_transport_dv_data.conf b/src/dv/test_transport_dv_data.conf index a48fe445c..7226f561b 100644 --- a/src/dv/test_transport_dv_data.conf +++ b/src/dv/test_transport_dv_data.conf | |||
@@ -11,4 +11,4 @@ AUTOSTART = YES | |||
11 | 11 | ||
12 | [set] | 12 | [set] |
13 | AUTOSTART = YES | 13 | AUTOSTART = YES |
14 | #PREFIX = valgrind \ No newline at end of file | 14 | PREFIX = valgrind |