diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 11:15:55 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 11:15:55 +0000 |
commit | 52c4711deb6393d51f984c575f1fa065a56c98f8 (patch) | |
tree | 70a922e6aad8eacfd1d41912f5f70627f7f1ff2f /src/dv | |
parent | 34c384edf42db39955b54a640dc37e7067217229 (diff) | |
download | gnunet-52c4711deb6393d51f984c575f1fa065a56c98f8.tar.gz gnunet-52c4711deb6393d51f984c575f1fa065a56c98f8.zip |
check address change, remove unused debugging case
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 6 | ||||
-rw-r--r-- | src/dv/plugin_transport_dv.c | 26 |
2 files changed, 14 insertions, 18 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 3882335b0..c1f5ec8c5 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -3015,12 +3015,6 @@ run (void *cls, | |||
3015 | GNUNET_TIME_UNIT_FOREVER_REL, | 3015 | GNUNET_TIME_UNIT_FOREVER_REL, |
3016 | &shutdown_task, | 3016 | &shutdown_task, |
3017 | NULL); | 3017 | NULL); |
3018 | #if INSANE_GOSSIP | ||
3019 | GNUNET_SCHEDULER_add_delayed (sched, | ||
3020 | GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5), | ||
3021 | &gossip_all_to_all, | ||
3022 | NULL); | ||
3023 | #endif | ||
3024 | } | 3018 | } |
3025 | 3019 | ||
3026 | 3020 | ||
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index a49c27619..21f90cc47 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c | |||
@@ -342,21 +342,24 @@ static const char *address_to_string (void *cls, | |||
342 | } | 342 | } |
343 | 343 | ||
344 | /** | 344 | /** |
345 | * Another peer has suggested an address for this | 345 | * Another peer has suggested an address for this peer and transport |
346 | * peer and transport plugin. Check that this could be a valid | 346 | * plugin. Check that this could be a valid address. This function |
347 | * address. If so, consider adding it to the list | 347 | * is not expected to 'validate' the address in the sense of trying to |
348 | * of addresses. | 348 | * connect to it but simply to see if the binary format is technically |
349 | * legal for establishing a connection to this peer (and make sure that | ||
350 | * the address really corresponds to our network connection/settings | ||
351 | * and not some potential man-in-the-middle). | ||
349 | * | 352 | * |
350 | * @param cls closure | 353 | * @param cls closure |
351 | * @param addr pointer to the address | 354 | * @param addr pointer to the address |
352 | * @param addrlen length of addr | 355 | * @param addrlen length of addr |
353 | * @return GNUNET_OK if this is a plausible address for this peer | 356 | * @return GNUNET_OK if this is a plausible address for this peer |
354 | * and transport | 357 | * and transport, GNUNET_SYSERR if not |
355 | * | 358 | * |
356 | */ | 359 | */ |
357 | static int | 360 | static int |
358 | dv_plugin_address_suggested (void *cls, | 361 | dv_plugin_check_address (void *cls, |
359 | void *addr, size_t addrlen) | 362 | const void *addr, size_t addrlen) |
360 | { | 363 | { |
361 | struct Plugin *plugin = cls; | 364 | struct Plugin *plugin = cls; |
362 | /* Verify that the first peer of this address matches our peer id! */ | 365 | /* Verify that the first peer of this address matches our peer id! */ |
@@ -365,12 +368,11 @@ dv_plugin_address_suggested (void *cls, | |||
365 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: Address not correct size or identity doesn't match ours!\n", GNUNET_i2s(plugin->env->my_identity)); | 368 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: Address not correct size or identity doesn't match ours!\n", GNUNET_i2s(plugin->env->my_identity)); |
366 | if (addrlen == (2 * sizeof(struct GNUNET_PeerIdentity))) | 369 | if (addrlen == (2 * sizeof(struct GNUNET_PeerIdentity))) |
367 | { | 370 | { |
368 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer in addr is %s\n", GNUNET_i2s(addr)); | 371 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer in address is %s\n", GNUNET_i2s(addr)); |
369 | } | 372 | } |
370 | return GNUNET_NO; | 373 | return GNUNET_SYSERR; |
371 | } | 374 | } |
372 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: Address verified!\n", GNUNET_i2s(plugin->env->my_identity)); | 375 | return GNUNET_OK; |
373 | return GNUNET_YES; | ||
374 | } | 376 | } |
375 | 377 | ||
376 | 378 | ||
@@ -400,7 +402,7 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
400 | api->send = &dv_plugin_send; | 402 | api->send = &dv_plugin_send; |
401 | api->disconnect = &dv_plugin_disconnect; | 403 | api->disconnect = &dv_plugin_disconnect; |
402 | api->address_pretty_printer = &dv_plugin_address_pretty_printer; | 404 | api->address_pretty_printer = &dv_plugin_address_pretty_printer; |
403 | api->check_address = &dv_plugin_address_suggested; | 405 | api->check_address = &dv_plugin_check_address; |
404 | api->address_to_string = &address_to_string; | 406 | api->address_to_string = &address_to_string; |
405 | return api; | 407 | return api; |
406 | } | 408 | } |