aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-03-22 02:58:27 +0000
committerBart Polot <bart@net.in.tum.de>2014-03-22 02:58:27 +0000
commit385be0020578886f054ef2a0ef74dfa1d1a3bfb3 (patch)
treee4787f0a4294aa387828ec1fc286c27808b7eb42 /src/mesh
parentaa4b25956a928a876f2a34e91022f024c642d65c (diff)
downloadgnunet-385be0020578886f054ef2a0ef74dfa1d1a3bfb3.tar.gz
gnunet-385be0020578886f054ef2a0ef74dfa1d1a3bfb3.zip
- check path length AFTER shortening
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh_peer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c
index 05b924eda..c1fc835a2 100644
--- a/src/mesh/gnunet-service-mesh_peer.c
+++ b/src/mesh/gnunet-service-mesh_peer.c
@@ -1664,12 +1664,7 @@ GMP_add_path (struct MeshPeer *peer, struct MeshPeerPath *path,
1664 path_destroy (path); 1664 path_destroy (path);
1665 return NULL; 1665 return NULL;
1666 } 1666 }
1667 if (2 >= path->length && GNUNET_NO == trusted) 1667
1668 {
1669 /* Only allow CORE to tell us about direct paths */
1670 path_destroy (path);
1671 return NULL;
1672 }
1673 for (l = 1; l < path->length; l++) 1668 for (l = 1; l < path->length; l++)
1674 { 1669 {
1675 if (path->peers[l] == myid) 1670 if (path->peers[l] == myid)
@@ -1688,6 +1683,13 @@ GMP_add_path (struct MeshPeer *peer, struct MeshPeerPath *path,
1688 1683
1689 LOG (GNUNET_ERROR_TYPE_DEBUG, " final length: %u\n", path->length); 1684 LOG (GNUNET_ERROR_TYPE_DEBUG, " final length: %u\n", path->length);
1690 1685
1686 if (2 >= path->length && GNUNET_NO == trusted)
1687 {
1688 /* Only allow CORE to tell us about direct paths */
1689 path_destroy (path);
1690 return NULL;
1691 }
1692
1691 l = path_get_length (path); 1693 l = path_get_length (path);
1692 if (0 == l) 1694 if (0 == l)
1693 { 1695 {