diff options
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 15 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.h | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index f3dd8ca167..f1dc2dfc90 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -171,7 +171,7 @@ struct MeshConnection /** * ID of the connection. */ - struct GNUNET_HashCode id; + struct GNUNET_MeshHash id; /** * State of the connection. @@ -413,9 +413,16 @@ fc_init (struct MeshFlowControl *fc) * @param cid Connection ID. */ static struct MeshConnection * -connection_get (const struct GNUNET_HashCode *cid) +connection_get (const struct GNUNET_MeshHash *cid) { - return GNUNET_CONTAINER_multihashmap_get (connections, cid); + struct GNUNET_HashCode hash; + struct GNUNET_MeshHash *aux; + + memcpy (&hash, cid, sizeof (cid)); + aux = (struct GNUNET_MeshHash *) &hash; + memset (&aux[1], 0, sizeof (hash) - sizeof (*cid)); + + return GNUNET_CONTAINER_multihashmap_get (connections, &hash); } @@ -2507,7 +2514,7 @@ GMC_destroy (struct MeshConnection *c) * * @return ID of the connection. */ -const struct GNUNET_HashCode * +const struct GNUNET_MeshHash * GMC_get_id (const struct MeshConnection *c) { return &c->id; diff --git a/src/mesh/gnunet-service-mesh_connection.h b/src/mesh/gnunet-service-mesh_connection.h index f4722a6fce..ec11cb8aba 100644 --- a/src/mesh/gnunet-service-mesh_connection.h +++ b/src/mesh/gnunet-service-mesh_connection.h @@ -289,7 +289,7 @@ GMC_destroy (struct MeshConnection *c); * * @return ID of the connection. */ -const struct GNUNET_HashCode * +const struct GNUNET_MeshHash * GMC_get_id (const struct MeshConnection *c); /** |