diff options
-rw-r--r-- | src/mesh/gnunet-service-mesh-new.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index 77406d9b0..ef04ea259 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c | |||
@@ -3485,6 +3485,7 @@ handle_mesh_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3485 | struct MeshTunnel *t; | 3485 | struct MeshTunnel *t; |
3486 | size_t size; | 3486 | size_t size; |
3487 | uint32_t pid; | 3487 | uint32_t pid; |
3488 | uint32_t ttl; | ||
3488 | 3489 | ||
3489 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "got a ToOrigin packet from %s\n", | 3490 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "got a ToOrigin packet from %s\n", |
3490 | GNUNET_i2s (peer)); | 3491 | GNUNET_i2s (peer)); |
@@ -3568,6 +3569,15 @@ handle_mesh_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3568 | GNUNET_i2s (&msg->oid), ntohl(msg->tid)); | 3569 | GNUNET_i2s (&msg->oid), ntohl(msg->tid)); |
3569 | return GNUNET_OK; | 3570 | return GNUNET_OK; |
3570 | } | 3571 | } |
3572 | ttl = ntohl (msg->ttl); | ||
3573 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " ttl: %u\n", ttl); | ||
3574 | if (ttl == 0) | ||
3575 | { | ||
3576 | GNUNET_STATISTICS_update (stats, "# TTL drops", 1, GNUNET_NO); | ||
3577 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, " TTL is 0, DROPPING!\n"); | ||
3578 | tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_ACK); | ||
3579 | return GNUNET_OK; | ||
3580 | } | ||
3571 | send_prebuilt_message (message, t->prev_hop, t); | 3581 | send_prebuilt_message (message, t->prev_hop, t); |
3572 | GNUNET_STATISTICS_update (stats, "# to origin forwarded", 1, GNUNET_NO); | 3582 | GNUNET_STATISTICS_update (stats, "# to origin forwarded", 1, GNUNET_NO); |
3573 | 3583 | ||