From 74e96c6a5a09d2c4c9f71f3a4eeef33240a1e90e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 27 Jun 2012 11:18:54 +0000 Subject: [PATCH] -fixing the schanzenbug --- src/include/gnunet_dnsparser_lib.h | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index a36996432..a3a77edf2 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h @@ -79,6 +79,7 @@ */ struct GNUNET_DNSPARSER_Flags { +#if __BYTE_ORDER == __LITTLE_ENDIAN /** * Set to 1 if recursion is desired (client -> server) */ @@ -128,6 +129,61 @@ struct GNUNET_DNSPARSER_Flags * Set to 1 if recursion is available (server -> client) */ unsigned int recursion_available : 1 GNUNET_PACKED; +#elif __BYTE_ORDER == __BIG_ENDIAN + + /** + * See GNUNET_DNSPARSER_RETURN_CODE_ defines. + */ + unsigned int return_code : 4 GNUNET_PACKED; + + /** + * See RFC 4035. + */ + unsigned int checking_disabled : 1 GNUNET_PACKED; + + /** + * Response has been cryptographically verified, RFC 4035. + */ + unsigned int authenticated_data : 1 GNUNET_PACKED; + + /** + * Always zero. + */ + unsigned int zero : 1 GNUNET_PACKED; + + /** + * Set to 1 if recursion is available (server -> client) + */ + unsigned int recursion_available : 1 GNUNET_PACKED; + + /** + * Set to 1 if recursion is desired (client -> server) + */ + unsigned int recursion_desired : 1 GNUNET_PACKED; + + /** + * Set to 1 if message is truncated + */ + unsigned int message_truncated : 1 GNUNET_PACKED; + + /** + * Set to 1 if this is an authoritative answer + */ + unsigned int authoritative_answer : 1 GNUNET_PACKED; + + /** + * See GNUNET_DNSPARSER_OPCODE_ defines. + */ + unsigned int opcode : 4 GNUNET_PACKED; + + /** + * query:0, response:1 + */ + unsigned int query_or_response : 1 GNUNET_PACKED; + +#else + #error byteorder undefined +#endif } GNUNET_GCC_STRUCT_LAYOUT; -- 2.25.1