aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_core.c
diff options
context:
space:
mode:
authorxrs <xrs@mail36.net>2020-06-17 22:07:39 +0200
committerxrs <xrs@mail36.net>2020-06-17 22:07:39 +0200
commit49cf7a8e893eaf7682ac12c7d0ea5ca4a6d1a73d (patch)
tree71830c1751e291e45795958cad15e9dfa8239e1a /src/cadet/gnunet-service-cadet_core.c
parentb9333fef25b57bdd7f556f5fb73f9abaef9bc5ef (diff)
parente500e9ec3678dfbb666d173854c134ac3858f8b1 (diff)
downloadgnunet-49cf7a8e893eaf7682ac12c7d0ea5ca4a6d1a73d.tar.gz
gnunet-49cf7a8e893eaf7682ac12c7d0ea5ca4a6d1a73d.zip
Merge branch 'master' into rewrite_of_cadet_test
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 {