]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: resolvers: fix attribute packed struct for dns
authorEmeric Brun <ebrun@haproxy.com>
Wed, 23 Dec 2020 14:55:03 +0000 (15:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Feb 2021 08:43:17 +0000 (09:43 +0100)
This patch adds the attribute packed on struct dns_question
because it is directly memcpy to network building a response.

This patch also removes the commented line:
//     struct list options;       /* list of option records */

because it is also used directly using memcpy to build a request
and must not contain host data.

include/haproxy/dns-t.h

index c9199045c7cfd62c59cb60be9a657e258ebad2ce..b1656b6a236c586e1d3d40315918267022b3b8f3 100644 (file)
@@ -110,7 +110,7 @@ struct dns_header {
 struct dns_question {
        unsigned short qtype;   /* question type */
        unsigned short qclass;  /* query class */
-};
+} __attribute__ ((packed));
 
 /* NOTE: big endian structure */
 struct dns_query_item {
@@ -131,7 +131,6 @@ struct dns_additional_record {
  * placeholder here for this purpose. We may need to define a dns_option_record
  * structure which itself should point to different type of data, based on the
  * extension set (client subnet, tcp keepalive, etc...)*/
-//     struct list options;       /* list of option records */
 } __attribute__ ((packed));
 
 /* NOTE: big endian structure */