diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-18 14:08:39 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-18 14:08:39 +0000 |
commit | 8bd00cee8c4335f9598ef6e97a06736c925862a7 (patch) | |
tree | 657258e0b9f88de9a81dfda64dc6629f3a0d370b /src/transport/gnunet-service-transport_validation.c | |
parent | 060807231ea955a26c481700811dc265908a3138 (diff) | |
download | gnunet-8bd00cee8c4335f9598ef6e97a06736c925862a7.tar.gz gnunet-8bd00cee8c4335f9598ef6e97a06736c925862a7.zip |
fix blacklist checking logic, integrating tracking of sessions with blacklist module and fixing dangling session issue which caused misc. problems when blacklists were in use
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 2022a8c47..de6edc90a 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -505,11 +505,17 @@ timeout_hello_validation (void *cls, | |||
505 | * | 505 | * |
506 | * @param cls our `struct ValidationEntry` | 506 | * @param cls our `struct ValidationEntry` |
507 | * @param pid identity of the other peer | 507 | * @param pid identity of the other peer |
508 | * @param result #GNUNET_OK if the connection is allowed, #GNUNET_NO if not | 508 | * @param address_null address associated with the request, always NULL |
509 | * @param session_null session associated with the request, always NULL | ||
510 | * @param result #GNUNET_OK if the connection is allowed, | ||
511 | * #GNUNET_NO if not, | ||
512 | * #GNUNET_SYSERR if operation was aborted | ||
509 | */ | 513 | */ |
510 | static void | 514 | static void |
511 | transmit_ping_if_allowed (void *cls, | 515 | transmit_ping_if_allowed (void *cls, |
512 | const struct GNUNET_PeerIdentity *pid, | 516 | const struct GNUNET_PeerIdentity *pid, |
517 | const struct GNUNET_HELLO_Address *address_null, | ||
518 | struct Session *session_null, | ||
513 | int result) | 519 | int result) |
514 | { | 520 | { |
515 | struct ValidationEntry *ve = cls; | 521 | struct ValidationEntry *ve = cls; |
@@ -524,7 +530,7 @@ transmit_ping_if_allowed (void *cls, | |||
524 | struct Session *session; | 530 | struct Session *session; |
525 | 531 | ||
526 | ve->bc = NULL; | 532 | ve->bc = NULL; |
527 | if (GNUNET_NO == result) | 533 | if (GNUNET_OK != result) |
528 | { | 534 | { |
529 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 535 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
530 | "Blacklist denies sending PING to `%s' `%s' `%s'\n", | 536 | "Blacklist denies sending PING to `%s' `%s' `%s'\n", |
@@ -743,7 +749,10 @@ revalidate_address (void *cls, | |||
743 | GNUNET_NO); | 749 | GNUNET_NO); |
744 | bc = GST_blacklist_test_allowed (&ve->address->peer, | 750 | bc = GST_blacklist_test_allowed (&ve->address->peer, |
745 | ve->address->transport_name, | 751 | ve->address->transport_name, |
746 | &transmit_ping_if_allowed, ve); | 752 | &transmit_ping_if_allowed, |
753 | ve, | ||
754 | NULL, | ||
755 | NULL); | ||
747 | if (NULL != bc) | 756 | if (NULL != bc) |
748 | ve->bc = bc; /* only set 'bc' if 'transmit_ping_if_allowed' was not already | 757 | ve->bc = bc; /* only set 'bc' if 'transmit_ping_if_allowed' was not already |
749 | * called... */ | 758 | * called... */ |