Merge pull request #1217 from 42wim/fix-rfc2308-part3
No NXDOMAIN when the answer is empty
This commit is contained in:
commit
d63749b30e
|
@ -532,7 +532,6 @@ RPC:
|
|||
// If the answer is empty, return not found
|
||||
if len(resp.Answer) == 0 {
|
||||
d.addSOA(d.domain, resp)
|
||||
resp.SetRcode(req, dns.RcodeNameError)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2062,6 +2062,10 @@ func TestDNS_NonExistingLookupEmptyAorAAAA(t *testing.T) {
|
|||
t.Fatalf("Bad: %#v", in.Ns[0])
|
||||
}
|
||||
|
||||
if in.Rcode != dns.RcodeSuccess {
|
||||
t.Fatalf("Bad: %#v", in)
|
||||
}
|
||||
|
||||
// check for ipv4 records on ipv6 only service
|
||||
m.SetQuestion("webv6.service.consul.", dns.TypeA)
|
||||
|
||||
|
@ -2081,4 +2085,9 @@ func TestDNS_NonExistingLookupEmptyAorAAAA(t *testing.T) {
|
|||
if soaRec.Hdr.Ttl != 0 {
|
||||
t.Fatalf("Bad: %#v", in.Ns[0])
|
||||
}
|
||||
|
||||
if in.Rcode != dns.RcodeSuccess {
|
||||
t.Fatalf("Bad: %#v", in)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue