From: Anthonin Bonnefoy <anthonin.bonne...@datadoghq.com>

With EDNS, DNS packets can have a maximum size of 65507.
This will allow to have a bigger accepted_payload_size which is useful
when we have more than 100 SRV records.
---
 include/types/dns.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/types/dns.h b/include/types/dns.h
index 488d3996..53f24c19 100644
--- a/include/types/dns.h
+++ b/include/types/dns.h
@@ -42,7 +42,10 @@
  */
 #define DNS_MAX_LABEL_SIZE   63
 #define DNS_MAX_NAME_SIZE    255
-#define DNS_MAX_UDP_MESSAGE  8192
+/* With EDNS, DNS message can reach the maximum size of an UDP message
+ * which is (65535 - 8 bytes UDP header - 20 bytes IP header)
+ */
+#define DNS_MAX_UDP_MESSAGE  65507
 
 /* DNS minimun record size: 1 char + 1 NULL + type + class */
 #define DNS_MIN_RECORD_SIZE  (1 + 1 + 2 + 2)
-- 
2.13.2


Reply via email to