]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: dns: new MAX values
authorBaptiste Assmann <bedis9@gmail.com>
Wed, 9 Dec 2015 13:02:01 +0000 (14:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Sep 2016 17:53:41 +0000 (19:53 +0200)
DNS_MIN_RECORD_SIZE: minimal size of a DNS record

DNS_MAX_QUERY_RECORDS: maximum number of query records we allow.
  For now, we send one DNS query per request.

DNS_MAX_ANSWER_RECORDS: maximum number of records we may found in a
  response

WIP dns: new MAX values

include/types/dns.h

index 19c6edcc6f6634e71cb4bc800d88577cbe2f2f9a..01d42f92d7c0bdf07cad89df23abd73399fc089b 100644 (file)
 #define DNS_MAX_NAME_SIZE      255
 #define DNS_MAX_UDP_MESSAGE    512
 
+/* DNS minimun record size: 1 char + 1 NULL + type + class */
+#define DNS_MIN_RECORD_SIZE    ( 1 + 1 + 2 + 2 )
+
+/* maximum number of query records in a DNS response
+ * For now, we allow only one */
+#define DNS_MAX_QUERY_RECORDS 1
+
+/* maximum number of answer record in a DNS response */
+#define DNS_MAX_ANSWER_RECORDS ((DNS_MAX_UDP_MESSAGE - DNS_HEADER_SIZE) / DNS_MIN_RECORD_SIZE)
+
 /* DNS error messages */
 #define DNS_TOO_LONG_FQDN      "hostname too long"
 #define DNS_LABEL_TOO_LONG     "one label too long"