]> git.pld-linux.org Git - packages/pjproject.git/blame - 0004-resolver.c-Prevent-SERVFAIL-from-marking-name-server.patch
Patches and config_site.h updates from Asterisk 13.12
[packages/pjproject.git] / 0004-resolver.c-Prevent-SERVFAIL-from-marking-name-server.patch
CommitLineData
14efab78
JK
1From a5efddbe9151e9ad99279e59566c86f8bc27d3a9 Mon Sep 17 00:00:00 2001
2From: George Joseph <gjoseph@digium.com>
3Date: Wed, 7 Sep 2016 13:10:57 -0600
4Subject: [PATCH] resolver.c: Prevent SERVFAIL from marking name server bad
5
6A name server that returns "Server Failure" is indicating only that
7the server couldn't process that particular request. We should NOT
8assume that the name server is incapable of serving other requests.
9
10Here's the scenario we've been encountering...
11
12* 2 local name servers configured in resolv.conf.
13* An OPTIONS request causes a request for A and AAAA records to go out
14 to both nameservers.
15* The A responses both come back successfully resolved.
16* Because of an issue at some upstream nameserver, the AAAA responses
17 for that particular query come back as "SERVFAIL" from both local
18 name servers.
19* Both local servers are marked as bad and no further queries can be
20 sent until the 60 second ttl expires. Only previously cached results
21 can be used.
22* In this case, 60 seconds is just enough time for another OPTIONS
23 request to go out to the same host so the cycle repeats.
24
25We could set the bad ttl really low but that also affects REFUSED and
26NOTAUTH which probably DO signal a real server issue. Besides, even
27a really low bad ttl would be an issue on a pbx.
28---
29 pjlib-util/src/pjlib-util/resolver.c | 3 +--
30 1 file changed, 1 insertion(+), 2 deletions(-)
31
32diff --git a/pjlib-util/src/pjlib-util/resolver.c b/pjlib-util/src/pjlib-util/resolver.c
33index d277e4f..540f88f 100644
34--- a/pjlib-util/src/pjlib-util/resolver.c
35+++ b/pjlib-util/src/pjlib-util/resolver.c
36@@ -1384,8 +1384,7 @@ static void report_nameserver_status(pj_dns_resolver *resolver,
37 q_id = (pj_uint32_t)-1;
38 }
39
40- if (!pkt || rcode == PJ_DNS_RCODE_SERVFAIL ||
41- rcode == PJ_DNS_RCODE_REFUSED ||
42+ if (!pkt || rcode == PJ_DNS_RCODE_REFUSED ||
43 rcode == PJ_DNS_RCODE_NOTAUTH)
44 {
45 is_good = PJ_FALSE;
46--
472.7.4
48
This page took 0.200125 seconds and 4 git commands to generate.