CNAMEs targets should be in answer section.

A target of a cname must be put in the answer section. Fix this and add
a AAAA test for quad-AAAA CNAME responses.

Fixes #125
This commit is contained in:
Miek Gieben
2016-04-16 17:55:11 +01:00
parent dfe5cae114
commit 4e3c82bec5
3 changed files with 12 additions and 12 deletions

View File

@@ -151,15 +151,15 @@ func (z *Zone) lookupCNAME(rrs []dns.RR, qtype uint16, do bool) ([]dns.RR, []dns
if elem == nil {
return rrs, nil, nil, Success
}
extra := cnameForType(elem.All(), qtype)
targets := cnameForType(elem.All(), qtype)
if do {
sigs := elem.Types(dns.TypeRRSIG)
sigs = signatureForSubType(sigs, qtype)
if len(sigs) > 0 {
extra = append(extra, sigs...)
targets = append(targets, sigs...)
}
}
return rrs, nil, extra, Success
return append(rrs, targets...), nil, nil, Success
}
func cnameForType(targets []dns.RR, origQtype uint16) []dns.RR {