- fix ACK for TO_ORIG traffic
authorBart Polot <bart@net.in.tum.de>
Thu, 18 Jul 2013 12:35:37 +0000 (12:35 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 18 Jul 2013 12:35:37 +0000 (12:35 +0000)
src/mesh/gnunet-service-mesh.c

index 37e9889120fb77e1bc57e4b2839c494df860a979..910d96eee5c6fff32e0cd8cc97f650eabca07eb8 100644 (file)
@@ -3948,11 +3948,9 @@ handle_mesh_data (const struct GNUNET_PeerIdentity *peer,
   GNUNET_PEER_Id hop;
   uint32_t pid;
   uint32_t ttl;
+  uint16_t type;
   size_t size;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "got a %s message from %s\n",
-              GNUNET_MESH_DEBUG_M2S (ntohs (message->type)),
-              GNUNET_i2s (peer));
   /* Check size */
   size = ntohs (message->size);
   if (size <
@@ -3962,6 +3960,9 @@ handle_mesh_data (const struct GNUNET_PeerIdentity *peer,
     GNUNET_break (0);
     return GNUNET_OK;
   }
+  type =ntohs (message->type);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "got a %s message from %s\n",
+              GNUNET_MESH_DEBUG_M2S (type), GNUNET_i2s (peer));
   msg = (struct GNUNET_MESH_Data *) message;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " payload of type %s\n",
               GNUNET_MESH_DEBUG_M2S (ntohs (msg[1].header.type)));
@@ -4047,7 +4048,7 @@ handle_mesh_data (const struct GNUNET_PeerIdentity *peer,
                   " Pid %u not expected (%u+), dropping!\n",
                   pid, fc->last_pid_recv + 1);
     }
-    tunnel_send_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST, fwd);
+    tunnel_send_ack (t, type, fwd);
     return GNUNET_OK;
   }
   fc->last_pid_recv = pid;