From 80fa99877fa3d00307c3cf724e9ca4c9a2c2cdac Mon Sep 17 00:00:00 2001 From: Markus Linnala Date: Thu, 3 Oct 2019 20:25:20 +0300 Subject: [PATCH] cleanup: proxy: use symbolic code for SERVFAIL --- dnscrypt-proxy/proxy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dnscrypt-proxy/proxy.go b/dnscrypt-proxy/proxy.go index fc35fe65..559bfa06 100644 --- a/dnscrypt-proxy/proxy.go +++ b/dnscrypt-proxy/proxy.go @@ -13,6 +13,7 @@ import ( "github.com/jedisct1/dlog" clocksmith "github.com/jedisct1/go-clocksmith" stamps "github.com/jedisct1/go-dnsstamps" + "github.com/miekg/dns" "golang.org/x/crypto/curve25519" ) @@ -453,7 +454,7 @@ func (proxy *Proxy) processIncomingQuery(serverInfo *ServerInfo, clientProto str serverInfo.noticeFailure(proxy) return } - if rcode := Rcode(response); rcode == 2 { // SERVFAIL + if rcode := Rcode(response); rcode == dns.RcodeServerFailure { dlog.Infof("Server [%v] returned temporary error code [%v] -- Upstream server may be experiencing connectivity issues", serverInfo.Name, rcode) serverInfo.noticeFailure(proxy) } else {