- fix cadet's overhead
authorBart Polot <bart@net.in.tum.de>
Mon, 15 Dec 2014 07:30:46 +0000 (07:30 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 15 Dec 2014 07:30:46 +0000 (07:30 +0000)
src/cadet/gnunet-service-cadet_tunnel.c
src/include/gnunet_constants.h

index 7c420843e1638c3b60741565c268d8352a58d92c..f1cbad63c788e312f50ce9d5b4084a0d22cda19d 100644 (file)
@@ -2184,8 +2184,10 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c,
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n");
 
-  expected_overhead =
-    sizeof (struct GNUNET_CADET_Encrypted) + sizeof (struct GNUNET_CADET_Data);
+  expected_overhead = 0;
+  expected_overhead += sizeof (struct GNUNET_CADET_Encrypted);
+  expected_overhead += sizeof (struct GNUNET_CADET_Data);
+  expected_overhead += sizeof (struct GNUNET_CADET_ACK);
   GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead);
 
   if (GNUNET_OK !=
index 9ef500388d7bda0f4c041737aaad97a5617193da..36fa72bd0328d6abc4aba38cac456e29500805b5 100644 (file)
@@ -121,10 +121,14 @@ extern "C"
 #define GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE (63 * 1024)
 
 /**
- * Size of the CADET message overhead.
- * See gnunet-service-cadet_tunnel.c: GCT_init for more info.
+ * Size of the CADET message overhead:
+ * + sizeof (struct GNUNET_CADET_Encrypted)
+ * + sizeof (struct GNUNET_CADET_Data)
+ * + sizeof (struct GNUNET_CADET_ACK))
+ *
+ * Checked for correcteness in gnunet-service-cadet_tunnel.c: GCT_init().
  */
-#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD 92
+#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD 132
 
 /**
  * Maximum message size that can be sent on CADET.