diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-11 16:03:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-11 16:03:23 +0000 |
commit | 6c558bec246145418131dbb8ced6261f7ad4efa8 (patch) | |
tree | 0c5b96cc0cb3d8cf50150d96ec8d8574fbd76d29 /src/transport/gnunet-service-transport_validation.c | |
parent | f8f90fbb5bc4d4f6fd478ebfebfc25143719844f (diff) | |
download | gnunet-6c558bec246145418131dbb8ced6261f7ad4efa8.tar.gz gnunet-6c558bec246145418131dbb8ced6261f7ad4efa8.zip |
enabling address check in validation
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index d467c71a7..bd4476082 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -956,6 +956,26 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | |||
956 | address.transport_name = addr; | 956 | address.transport_name = addr; |
957 | address.peer = GST_my_identity; | 957 | address.peer = GST_my_identity; |
958 | 958 | ||
959 | if (NULL == address.transport_name) | ||
960 | { | ||
961 | GNUNET_break (0); | ||
962 | } | ||
963 | if (NULL == (papi = GST_plugins_find (address.transport_name))) | ||
964 | { | ||
965 | /* we don't have the plugin for this address */ | ||
966 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Plugin `%s' not available, cannot confirm having this address \n", | ||
967 | address.transport_name) ; | ||
968 | return; | ||
969 | } | ||
970 | if (GNUNET_OK != papi->check_address (papi->cls, addrend, alen)) | ||
971 | { | ||
972 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Address `%s' is not one of my addresses, not confirming PING\n", | ||
973 | GST_plugins_a2s (&address)); | ||
974 | return; | ||
975 | } | ||
976 | else | ||
977 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Address `%s' is one of my addresses, confirming PING\n", | ||
978 | GST_plugins_a2s (&address)); /* DEBUGGING*/ | ||
959 | 979 | ||
960 | if (GNUNET_YES != GST_hello_test_address (&address, &sig_cache, &sig_cache_exp)) | 980 | if (GNUNET_YES != GST_hello_test_address (&address, &sig_cache, &sig_cache_exp)) |
961 | { | 981 | { |
@@ -1033,7 +1053,6 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | |||
1033 | 1053 | ||
1034 | /* first see if the session we got this PING from can be used to transmit | 1054 | /* first see if the session we got this PING from can be used to transmit |
1035 | * a response reliably */ | 1055 | * a response reliably */ |
1036 | papi = GST_plugins_find (sender_address->transport_name); | ||
1037 | if (papi == NULL) | 1056 | if (papi == NULL) |
1038 | ret = -1; | 1057 | ret = -1; |
1039 | else | 1058 | else |