From: Bart Polot Date: Mon, 27 Apr 2015 19:15:48 +0000 (+0000) Subject: - don't ttl drop ax X-Git-Tag: initial-import-from-subversion-38251~1985 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b02a5efc9038d8c2dcb5680c8e74fb4ec7919092;p=oweals%2Fgnunet.git - don't ttl drop ax --- 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);