From: Bart Polot Date: Mon, 27 Apr 2015 19:15:25 +0000 (+0000) Subject: - use correct overhead size, log wrong sizes verbosely X-Git-Tag: initial-import-from-subversion-38251~2001 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e2646ee53fc76e1df136ec62be240d55139013e0;p=oweals%2Fgnunet.git - use correct overhead size, log wrong sizes verbosely --- diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 0a6d537bb..e952b6e8c 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -2132,6 +2132,8 @@ check_message (const struct GNUNET_MessageHeader *message, if (ntohs (message->size) < minimum_size) { GNUNET_break_op (0); + LOG (GNUNET_ERROR_TYPE_WARNING, "Size %u < %u\n", + ntohs (message->size), minimum_size); return GNUNET_SYSERR; } diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 06f358e75..ad565cb94 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -1582,7 +1582,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message, { ax_msg = (struct GNUNET_CADET_AX *) cbuf; msg = &ax_msg->header; - msg->size = htons (sizeof (struct GNUNET_CADET_Encrypted) + size); + msg->size = htons (sizeof (struct GNUNET_CADET_AX) + size); msg->type = htons (GNUNET_MESSAGE_TYPE_CADET_AX); esize = t_ax_encrypt (t, &ax_msg[1], message, size); ax_msg->Ns = htonl (t->ax->Ns++);