- fix bck numbering (fixes multicast but breaks loopback, I know)
authorBart Polot <bart@net.in.tum.de>
Thu, 25 Oct 2012 19:40:43 +0000 (19:40 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 25 Oct 2012 19:40:43 +0000 (19:40 +0000)
src/mesh/gnunet-service-mesh.c

index a42f235d13e7731138c1064651459309834a541a..3f6fa5fd8e32e1aeb7467e97775cf1abd7fc5e7e 100644 (file)
@@ -7683,11 +7683,11 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
+  clinfo->bck_pid++;
 
   /* Ok, everything is correct, send the message
    * (pretend we got it from a mesh peer)
    */
-  clinfo->bck_pid++;
   {
     char buf[ntohs (message->size)] GNUNET_ALIGN;
     struct GNUNET_MESH_ToOrigin *copy;
@@ -7698,15 +7698,8 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_PEER_resolve (t->id.oid, &copy->oid);
     copy->tid = htonl (t->id.tid);
     copy->ttl = htonl (default_ttl);
-    if (ntohl (copy->pid) != (t->bck_pid + 1))
-    {
-      GNUNET_break (0);
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "To Origin PID, expected %u, got %u\n",
-                  t->bck_pid + 1,
-                  ntohl (copy->pid));
-      return;
-    }
+    copy->pid = htonl (++(t->bck_pid));
+
     copy->sender = my_full_id;
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "  calling generic handler...\n");