aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_core.c')
-rw-r--r--src/cadet/gnunet-service-cadet_core.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c
index d54022896..04847f906 100644
--- a/src/cadet/gnunet-service-cadet_core.c
+++ b/src/cadet/gnunet-service-cadet_core.c
@@ -227,7 +227,6 @@ static unsigned long long cur_buffers;
227 */ 227 */
228static struct GNUNET_SCHEDULER_Task *timeout_task; 228static struct GNUNET_SCHEDULER_Task *timeout_task;
229 229
230
231/** 230/**
232 * Get the route corresponding to a hash. 231 * Get the route corresponding to a hash.
233 * 232 *
@@ -724,6 +723,7 @@ handle_connection_create (
724 uint16_t size = ntohs (msg->header.size) - sizeof(*msg); 723 uint16_t size = ntohs (msg->header.size) - sizeof(*msg);
725 unsigned int path_length; 724 unsigned int path_length;
726 unsigned int off; 725 unsigned int off;
726 struct CadetTunnel *t;
727 727
728 path_length = size / sizeof(struct GNUNET_PeerIdentity); 728 path_length = size / sizeof(struct GNUNET_PeerIdentity);
729 if (0 == path_length) 729 if (0 == path_length)
@@ -822,8 +822,19 @@ handle_connection_create (
822 GCP_2s (origin), 822 GCP_2s (origin),
823 GNUNET_sh2s (&msg->cid.connection_of_tunnel)); 823 GNUNET_sh2s (&msg->cid.connection_of_tunnel));
824 path = GCPP_get_path_from_route (path_length - 1, pids); 824 path = GCPP_get_path_from_route (path_length - 1, pids);
825 t = GCP_get_tunnel (sender, GNUNET_YES);
826
827 // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss)
828 if ((GNUNET_YES == msg->has_monotime) &&
829 (GNUNET_YES == GCP_check_and_update_monotime(origin, msg->monotime)) &&
830 ( GNUNET_OK == GCP_check_monotime_sig(origin, msg)) &&
831 (CADET_TUNNEL_KEY_OK == GCT_get_estate(t)))
832 {
833 GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED);
834 }
835
825 if (GNUNET_OK != 836 if (GNUNET_OK !=
826 GCT_add_inbound_connection (GCP_get_tunnel (origin, GNUNET_YES), 837 GCT_add_inbound_connection (t,
827 &msg->cid, 838 &msg->cid,
828 path)) 839 path))
829 { 840 {