From afdfbb6c040443d1371c667ecc712254a35d515c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 9 Nov 2011 08:48:00 +0000 Subject: [PATCH] fix --- src/transport/gnunet-service-transport_neighbours.c | 3 ++- src/transport/gnunet-service-transport_validation.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index a127209dd..7dbe26436 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -1397,7 +1397,8 @@ GST_neighbour_get_latency (const struct GNUNET_PeerIdentity *peer) struct NeighbourMapEntry *n; n = lookup_neighbour (peer); - if (NULL == n) + if ( (NULL == n) || + ( (n->address == NULL) && (n->session == NULL) ) ) return GNUNET_TIME_UNIT_FOREVER_REL; return GST_validation_get_address_latency (peer, n->address, diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 9b93c7508..9b0fc0732 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -1208,6 +1208,11 @@ GST_validation_get_address_latency (const struct GNUNET_PeerIdentity *sender, { struct ValidationEntry *ve; + if (NULL == address) + { + GNUNET_break (0); // FIXME: support having latency only with session... + return GNUNET_TIME_UNIT_FOREVER_REL; + } ve = find_validation_entry (NULL, address); if (NULL == ve) return GNUNET_TIME_UNIT_FOREVER_REL; -- 2.25.1