- fix unreliable unicast
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh.c
index acf9bc3dd8b74922343ce8408409241b94bc7412..d7e3c0aa47cc4c7890890fac86aa13f91b610a21 100644 (file)
@@ -3750,12 +3750,14 @@ handle_mesh_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
     if (GMC_is_pid_bigger (pid, t->prev_fc.last_pid_recv)
         &&
           (GNUNET_NO == t->reliable ||
-           GNUNET_ntohll (msg->mid) == (t->bck_rel->mid_recv + 1)) )
+                     (GNUNET_ntohll (msg->mid) == (t->bck_rel->mid_recv + 1) &&
+                      t->bck_rel->mid_recv++) 
+          )
+       )
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   " pid %u not seen yet, forwarding\n", pid);
       t->prev_fc.last_pid_recv = pid;
-      t->bck_rel->mid_recv++;
       tunnel_send_client_ucast (t, msg);
     }
     else