- add framework for mesh2 mutipeer tests
[oweals/gnunet.git] / src / mesh / plugin_block_mesh.c
index 58faaa53803b1242ea8a5215f398383a07ccd1a1..3d99201f7877c2e6bfc91bc85e538d99eba1ce21 100644 (file)
@@ -149,6 +149,7 @@ block_plugin_mesh_get_key (void *cls, enum GNUNET_BLOCK_Type type,
                            struct GNUNET_HashCode * key)
 {
   const struct PBlock *pb;
+  GNUNET_MESH_ApplicationType app_type;
   pb = block;
 
   switch (type)
@@ -159,9 +160,11 @@ block_plugin_mesh_get_key (void *cls, enum GNUNET_BLOCK_Type type,
     *key = pb->id.hashPubKey;
     return GNUNET_OK;
   case GNUNET_BLOCK_TYPE_MESH_PEER_BY_TYPE:
-    GNUNET_CRYPTO_hash (&pb->type, sizeof(GNUNET_MESH_ApplicationType), key);
+    app_type = ntohl (pb->type);
+    GNUNET_CRYPTO_hash (&app_type, sizeof(GNUNET_MESH_ApplicationType), key);
     return GNUNET_OK;
   default:
+    GNUNET_break (0);
     return GNUNET_SYSERR;
   }
 }