]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/0090-Tweak-EDNS-timeout-code.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[ipfire-2.x.git] / src / patches / dnsmasq / 0090-Tweak-EDNS-timeout-code.patch
CommitLineData
efbd3a9a
MT
1From 86fa1046920dedc8134136a6244ca96e8a37e9d8 Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Sun, 10 May 2015 13:50:59 +0100
697b4f04 4Subject: [PATCH 090/113] Tweak EDNS timeout code.
efbd3a9a
MT
5
6---
7 src/forward.c | 6 ++++--
8 1 file changed, 4 insertions(+), 2 deletions(-)
9
10diff --git a/src/forward.c b/src/forward.c
11index 592243fd4d35..74e5ab66c423 100644
12--- a/src/forward.c
13+++ b/src/forward.c
14@@ -799,8 +799,10 @@ void reply_query(int fd, int family, time_t now)
15 }
16
17 /* We tried resending to this server with a smaller maximum size and got an answer.
18- Make that permanent. */
19- if (server && (forward->flags & FREC_TEST_PKTSZ))
20+ Make that permanent. To avoid reduxing the packet size for an single dropped packet,
21+ only do this when we get a truncated answer, or one larger than the safe size. */
22+ if (server && (forward->flags & FREC_TEST_PKTSZ) &&
23+ ((header->hb3 & HB3_TC) || n >= SAFE_PKTSZ))
24 server->edns_pktsz = SAFE_PKTSZ;
25
26 /* If the answer is an error, keep the forward record in place in case
27--
282.1.0