aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-10-11 16:19:02 +0000
committerBart Polot <bart@net.in.tum.de>2012-10-11 16:19:02 +0000
commit1d116671d2464dcf0bdbab9671be02bde339068a (patch)
tree43d0f54e3abf464850fe9933f0d9f1073e5f8b3a /src/mesh
parent9009722cb2a078e65c860315ded20e11fa9a3048 (diff)
downloadgnunet-1d116671d2464dcf0bdbab9671be02bde339068a.tar.gz
gnunet-1d116671d2464dcf0bdbab9671be02bde339068a.zip
- check for to_origin duplicates
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 1792faee8..006cc3b38 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -5742,7 +5742,6 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
5742 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " of type %s\n", 5742 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " of type %s\n",
5743 GNUNET_MESH_DEBUG_M2S (ntohs (msg[1].header.type))); 5743 GNUNET_MESH_DEBUG_M2S (ntohs (msg[1].header.type)));
5744 t = tunnel_get (&msg->oid, ntohl (msg->tid)); 5744 t = tunnel_get (&msg->oid, ntohl (msg->tid));
5745 pid = ntohl (msg->pid);
5746 5745
5747 if (NULL == t) 5746 if (NULL == t)
5748 { 5747 {
@@ -5755,6 +5754,22 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
5755 return GNUNET_OK; 5754 return GNUNET_OK;
5756 } 5755 }
5757 5756
5757 pid = ntohl (msg->pid);
5758 if (t->bck_pid == pid)
5759 {
5760 /* already seen this packet, drop */
5761 GNUNET_STATISTICS_update (stats, "# duplicate PID drops BCK", 1, GNUNET_NO);
5762 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5763 " Already seen pid %u, DROPPING!\n", pid);
5764 tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_ACK);
5765 return GNUNET_OK;
5766 }
5767 else
5768 {
5769 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5770 " pid %u not seen yet, forwarding\n", pid);
5771 }
5772
5758 if (NULL != t->owner) 5773 if (NULL != t->owner)
5759 { 5774 {
5760 char cbuf[size]; 5775 char cbuf[size];