gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24272 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r24272 - gnunet/src/mesh
Date: Thu, 11 Oct 2012 18:19:02 +0200

Author: bartpolot
Date: 2012-10-11 18:19:02 +0200 (Thu, 11 Oct 2012)
New Revision: 24272

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- check for to_origin duplicates

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-10-11 16:07:11 UTC (rev 
24271)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-10-11 16:19:02 UTC (rev 
24272)
@@ -5742,7 +5742,6 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " of type %s\n",
               GNUNET_MESH_DEBUG_M2S (ntohs (msg[1].header.type)));
   t = tunnel_get (&msg->oid, ntohl (msg->tid));
-  pid = ntohl (msg->pid);
 
   if (NULL == t)
   {
@@ -5755,6 +5754,22 @@
     return GNUNET_OK;
   }
 
+  pid = ntohl (msg->pid);
+  if (t->bck_pid == pid)
+  {
+    /* already seen this packet, drop */
+    GNUNET_STATISTICS_update (stats, "# duplicate PID drops BCK", 1, 
GNUNET_NO);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                " Already seen pid %u, DROPPING!\n", pid);
+    tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_ACK);
+    return GNUNET_OK;
+  }
+  else
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                " pid %u not seen yet, forwarding\n", pid);
+  }
+
   if (NULL != t->owner)
   {
     char cbuf[size];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]