From ef374afbbc5a305ad6e64d7658126d254fbdcb2d Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 16 Dec 2013 16:15:47 +0000 Subject: [PATCH] - stop kx on empty tunnels --- src/mesh/gnunet-service-mesh_tunnel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index c78984ece..e54c8046e 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -884,6 +884,7 @@ send_kx (struct MeshTunnel3 *t, if (NULL == c) { GNUNET_break (GNUNET_YES == t->destroy || MESH_TUNNEL3_READY != t->cstate); + GMT_debug (t); return; } type = ntohs (message->type); @@ -985,7 +986,7 @@ rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) t->rekey_task = GNUNET_SCHEDULER_NO_TASK; - LOG (GNUNET_ERROR_TYPE_DEBUG, "Re-key Tunnel\n"); + LOG (GNUNET_ERROR_TYPE_DEBUG, "Re-key Tunnel %s\n", GMT_2s (t)); if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) return; @@ -1924,6 +1925,12 @@ GMT_destroy_empty (struct MeshTunnel3 *t) GMC_send_destroy (iter->c); } + if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task) + { + t->estate = MESH_TUNNEL3_KEY_UNINITIALIZED; + GNUNET_SCHEDULER_cancel (t->rekey_task); + t->rekey_task = GNUNET_SCHEDULER_NO_TASK; + } t->cstate = MESH_TUNNEL3_NEW; t->destroy = GNUNET_YES; } -- 2.25.1