From ba59bf06eefaefa447fbca9059adefe9ac0ef167 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 4 Oct 2011 09:57:35 +0000 Subject: [PATCH] fix for 1819: when HELLO message arrives, peer's public key is added to peerinfo even no addresses could be validated --- src/transport/gnunet-service-transport_validation.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 7fcb76396..e16ccb56b 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -1021,6 +1021,7 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello) const struct GNUNET_HELLO_Message *hm = (const struct GNUNET_HELLO_Message *) hello; struct ValidateAddressContext vac; + struct GNUNET_HELLO_Message *h; if ((GNUNET_OK != GNUNET_HELLO_get_id (hm, &vac.pid)) || (GNUNET_OK != GNUNET_HELLO_get_key (hm, &vac.public_key))) @@ -1029,6 +1030,18 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello) GNUNET_break (0); return; } + /* Add peer identity without addresses to peerinfo service */ + h = GNUNET_HELLO_create (&vac.public_key, NULL, NULL); + GNUNET_PEERINFO_add_peer (GST_peerinfo, h); +#if VERBOSE_VALIDATION + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + _ + ("Adding `%s' without addresses for peer `%s'\n"), + "HELLO", + GNUNET_i2s(&vac.pid)); +#endif + GNUNET_free (h); + GNUNET_assert (NULL == GNUNET_HELLO_iterate_addresses (hm, GNUNET_NO, &validate_address, &vac)); -- 2.25.1