BUG/MINOR: resolvers: fix attribute packed struct for dns

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.
This commit is contained in:
Emeric Brun 2020-12-23 15:55:03 +01:00 committed by Willy Tarreau
parent 50c870e4de
commit 67f830d29d

View File

@ -110,7 +110,7 @@ struct dns_header {
struct dns_question { struct dns_question {
unsigned short qtype; /* question type */ unsigned short qtype; /* question type */
unsigned short qclass; /* query class */ unsigned short qclass; /* query class */
}; } __attribute__ ((packed));
/* NOTE: big endian structure */ /* NOTE: big endian structure */
struct dns_query_item { 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 * 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 * structure which itself should point to different type of data, based on the
* extension set (client subnet, tcp keepalive, etc...)*/ * extension set (client subnet, tcp keepalive, etc...)*/
// struct list options; /* list of option records */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* NOTE: big endian structure */ /* NOTE: big endian structure */