- cancel pending AX_KX when forced to send a KX by peer, fix #3927
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_tunnel.c
index 4ecb9f5990404367ba0e770f173e906804305233..34f5e4aa09fe241b89ebe6bfebf3cfdbb2af0d9d 100644 (file)
@@ -2906,7 +2906,11 @@ handle_kx_ax (struct CadetTunnel *t, const struct GNUNET_CADET_AX_KX *msg)
   }
 
   if (0 != (GNUNET_CADET_AX_KX_FLAG_FORCE_REPLY & ntohl (msg->flags)))
+  {
+    if (NULL != t->rekey_task)
+      GNUNET_SCHEDULER_cancel (t->rekey_task);
     GCT_send_ax_kx (t, GNUNET_NO);
+  }
 
   if (0 == memcmp (&ax->DHRr, &msg->ratchet_key, sizeof(msg->ratchet_key)))
   {