Skip to content

Commit

Permalink
Merge pull request #2551 from thaJeztah/fix_error_handling
Browse files Browse the repository at this point in the history
Resolver: fix error handling if we didn't receive a response
  • Loading branch information
arkodg authored May 21, 2020
2 parents 1ea375d + 15ead89 commit 2e24aed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) {
resp, err = co.ReadMsg()
// Truncated DNS replies should be sent to the client so that the
// client can retry over TCP
if err != nil && (resp != nil && !resp.Truncated) {
if err != nil && (resp == nil || !resp.Truncated) {
r.forwardQueryEnd()
logrus.Debugf("[resolver] read from DNS server failed, %s", err)
continue
Expand Down

0 comments on commit 2e24aed

Please sign in to comment.