From 5afc3372aec888e2db988ad30a889c4bc842e5ac Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 19 Feb 2017 00:28:17 +0100 Subject: [PATCH] trying to fix #4899 --- src/cadet/gnunet-service-cadet-new_tunnels.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c index f0ab86431..26983d465 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.c +++ b/src/cadet/gnunet-service-cadet-new_tunnels.c @@ -3008,8 +3008,21 @@ GCT_handle_encrypted (struct CadetTConnection *ct, case CADET_TUNNEL_KEY_UNINITIALIZED: case CADET_TUNNEL_KEY_AX_RECV: /* We did not even SEND our KX, how can the other peer - send us encrypted data? */ - GNUNET_break_op (0); + send us encrypted data? Must have been that we went + down and the other peer still things we are up. + Let's send it KX back. */ + GNUNET_STATISTICS_update (stats, + "# received encrypted without any KX", + 1, + GNUNET_NO); + if (NULL != t->kx_task) + { + GNUNET_SCHEDULER_cancel (t->kx_task); + t->kx_task = NULL; + } + send_kx (t, + ct, + &t->ax); return; case CADET_TUNNEL_KEY_AX_SENT_AND_RECV: /* We send KX, and other peer send KX to us at the same time. -- 2.25.1