diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-04 09:57:35 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-04 09:57:35 +0000 |
commit | ba59bf06eefaefa447fbca9059adefe9ac0ef167 (patch) | |
tree | 64f4826b613a803b4b9cb64361bffaf83196ebeb /src/transport/gnunet-service-transport_validation.c | |
parent | 21b693fef55a0cccbd82b9f8f287b9efb0aacf56 (diff) | |
download | gnunet-ba59bf06eefaefa447fbca9059adefe9ac0ef167.tar.gz gnunet-ba59bf06eefaefa447fbca9059adefe9ac0ef167.zip |
fix for 1819:
when HELLO message arrives, peer's public key is added to peerinfo even no addresses could be validated
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 13 |
1 files changed, 13 insertions, 0 deletions
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) | |||
1021 | const struct GNUNET_HELLO_Message *hm = | 1021 | const struct GNUNET_HELLO_Message *hm = |
1022 | (const struct GNUNET_HELLO_Message *) hello; | 1022 | (const struct GNUNET_HELLO_Message *) hello; |
1023 | struct ValidateAddressContext vac; | 1023 | struct ValidateAddressContext vac; |
1024 | struct GNUNET_HELLO_Message *h; | ||
1024 | 1025 | ||
1025 | if ((GNUNET_OK != GNUNET_HELLO_get_id (hm, &vac.pid)) || | 1026 | if ((GNUNET_OK != GNUNET_HELLO_get_id (hm, &vac.pid)) || |
1026 | (GNUNET_OK != GNUNET_HELLO_get_key (hm, &vac.public_key))) | 1027 | (GNUNET_OK != GNUNET_HELLO_get_key (hm, &vac.public_key))) |
@@ -1029,6 +1030,18 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello) | |||
1029 | GNUNET_break (0); | 1030 | GNUNET_break (0); |
1030 | return; | 1031 | return; |
1031 | } | 1032 | } |
1033 | /* Add peer identity without addresses to peerinfo service */ | ||
1034 | h = GNUNET_HELLO_create (&vac.public_key, NULL, NULL); | ||
1035 | GNUNET_PEERINFO_add_peer (GST_peerinfo, h); | ||
1036 | #if VERBOSE_VALIDATION | ||
1037 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1038 | _ | ||
1039 | ("Adding `%s' without addresses for peer `%s'\n"), | ||
1040 | "HELLO", | ||
1041 | GNUNET_i2s(&vac.pid)); | ||
1042 | #endif | ||
1043 | GNUNET_free (h); | ||
1044 | |||
1032 | GNUNET_assert (NULL == | 1045 | GNUNET_assert (NULL == |
1033 | GNUNET_HELLO_iterate_addresses (hm, GNUNET_NO, | 1046 | GNUNET_HELLO_iterate_addresses (hm, GNUNET_NO, |
1034 | &validate_address, &vac)); | 1047 | &validate_address, &vac)); |