From b02a5efc9038d8c2dcb5680c8e74fb4ec7919092 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 27 Apr 2015 19:15:48 +0000 Subject: [PATCH] - don't ttl drop ax --- src/cadet/gnunet-service-cadet_connection.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 4413602c6..8a3296a2c 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -2297,14 +2297,17 @@ handle_cadet_encrypted (const struct GNUNET_PeerIdentity *peer, /* Message not for us: forward to next hop */ LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n"); - ttl = ntohl (msg->ttl); - LOG (GNUNET_ERROR_TYPE_DEBUG, " ttl: %u\n", ttl); - if (ttl == 0) + if (NULL != otr_msg) /* only otr has ttl */ { - GNUNET_STATISTICS_update (stats, "# TTL drops", 1, GNUNET_NO); - LOG (GNUNET_ERROR_TYPE_WARNING, " TTL is 0, DROPPING!\n"); - GCC_send_ack (c, fwd, GNUNET_NO); - return GNUNET_OK; + ttl = ntohl (otr_msg->ttl); + LOG (GNUNET_ERROR_TYPE_DEBUG, " ttl: %u\n", ttl); + if (ttl == 0) + { + GNUNET_STATISTICS_update (stats, "# TTL drops", 1, GNUNET_NO); + LOG (GNUNET_ERROR_TYPE_WARNING, " TTL is 0, DROPPING!\n"); + GCC_send_ack (c, fwd, GNUNET_NO); + return GNUNET_OK; + } } GNUNET_STATISTICS_update (stats, "# messages forwarded", 1, GNUNET_NO); -- 2.25.1