|
| 1 | +From 11d7325dc418e2ca30c13f64ce237c4a5de3dd56 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Simon Kelley < [email protected]> |
| 3 | +Date: Wed, 8 Mar 2023 03:37:46 +0530 |
| 4 | +Subject: [PATCH] Set the default maximum DNS UDP packet size to 1232 |
| 5 | + |
| 6 | +Backported by @rohitrawat from upstream on 2023-03-23 |
| 7 | +Applies on v2.85 cleanly |
| 8 | + |
| 9 | +Signed-off-by: Rohit Rawat < [email protected]> |
| 10 | +--- |
| 11 | + man/dnsmasq.8 | 3 ++- |
| 12 | + src/config.h | 2 +- |
| 13 | + 2 files changed, 3 insertions(+), 2 deletions(-) |
| 14 | + |
| 15 | +diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 |
| 16 | +index fce580f..4b0b180 100644 |
| 17 | +--- a/man/dnsmasq.8 |
| 18 | ++++ b/man/dnsmasq.8 |
| 19 | +@@ -171,7 +171,8 @@ to zero completely disables DNS function, leaving only DHCP and/or TFTP. |
| 20 | + .TP |
| 21 | + .B \-P, --edns-packet-max=<size> |
| 22 | + Specify the largest EDNS.0 UDP packet which is supported by the DNS |
| 23 | +-forwarder. Defaults to 4096, which is the RFC5625-recommended size. |
| 24 | ++forwarder. Defaults to 1232, which is the recommended size following the |
| 25 | ++DNS flag day in 2020. Only increase if you know what you are doing. |
| 26 | + .TP |
| 27 | + .B \-Q, --query-port=<query_port> |
| 28 | + Send outbound DNS queries from, and listen for their replies on, the |
| 29 | +diff --git a/src/config.h b/src/config.h |
| 30 | +index 8c41943..62b7fa1 100644 |
| 31 | +--- a/src/config.h |
| 32 | ++++ b/src/config.h |
| 33 | +@@ -19,7 +19,7 @@ |
| 34 | + #define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */ |
| 35 | + #define TCP_MAX_QUERIES 100 /* Maximum number of queries per incoming TCP connection */ |
| 36 | + #define TCP_BACKLOG 32 /* kernel backlog limit for TCP connections */ |
| 37 | +-#define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */ |
| 38 | ++#define EDNS_PKTSZ 1232 /* default max EDNS.0 UDP packet from from /dnsflagday.net/2020 */ |
| 39 | + #define SAFE_PKTSZ 1280 /* "go anywhere" UDP packet size */ |
| 40 | + #define KEYBLOCK_LEN 40 /* choose to minimise fragmentation when storing DNSSEC keys */ |
| 41 | + #define DNSSEC_WORK 50 /* Max number of queries to validate one question */ |
| 42 | +-- |
| 43 | +2.17.1 |
| 44 | + |
0 commit comments