- fix port mangling
authorBart Polot <bart@net.in.tum.de>
Tue, 26 Nov 2013 16:06:43 +0000 (16:06 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 26 Nov 2013 16:06:43 +0000 (16:06 +0000)
src/mesh/gnunet-service-mesh_channel.c

index 4b510edc21cdeb91056e6f5eb34b86e609de5ead..6801525bb7abb98e352f23ee7c17d9ae3be4cb66 100644 (file)
@@ -1747,7 +1747,6 @@ GMCH_handle_create (struct MeshTunnel3 *t,
   MESH_ChannelNumber chid;
   struct MeshChannel *ch;
   struct MeshClient *c;
-  uint32_t port;
 
   chid = ntohl (msg->chid);
 
@@ -1761,9 +1760,9 @@ GMCH_handle_create (struct MeshTunnel3 *t,
   channel_set_options (ch, ntohl (msg->opt));
 
   /* Find a destination client */
-  port = ntohl (msg->port);
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "   port %u\n", port);
-  c = GML_client_get_by_port (port);
+  ch->port = ntohl (msg->port);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "   port %u\n", ch->port);
+  c = GML_client_get_by_port (ch->port);
   if (NULL == c)
   {
     /* TODO send reject */
@@ -1948,8 +1947,8 @@ GMCH_2s (const struct MeshChannel *ch)
   if (NULL == ch)
     return "(NULL Channel)";
 
-  sprintf (buf, "%s:%X (%X / %X)",
-           GMT_2s (ch->t), ch->gid, ch->lid_root, ch->lid_dest);
+  sprintf (buf, "%s:%u gid:%X (%X / %X)",
+           GMT_2s (ch->t), ch->port, ch->gid, ch->lid_root, ch->lid_dest);
 
   return buf;
 }