aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-06-19 17:49:39 +0000
committerBart Polot <bart@net.in.tum.de>2013-06-19 17:49:39 +0000
commit5533b105943b4f6dd688c1758350cd83ebeab3b9 (patch)
tree4ac552ee84f92f5692a655e930f2ad211cae3139
parentedfef0fec6a9cba64cd23a475d51397fc1cd5e46 (diff)
downloadgnunet-5533b105943b4f6dd688c1758350cd83ebeab3b9.tar.gz
gnunet-5533b105943b4f6dd688c1758350cd83ebeab3b9.zip
- drop to_orig messages on 0 ttl
-rw-r--r--src/mesh/gnunet-service-mesh-new.c10
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