Commit 1d3e9011 authored by xuweiwei's avatar xuweiwei Committed by GitHub

plugin/file: optimize cname get rr by type (#5080)

Signed-off-by: default avatarxuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
parent 1c6b68f3
......@@ -366,7 +366,7 @@ Redo:
goto Redo
}
targets := rrutil.CNAMEForType(elem.All(), qtype)
targets := elem.Type(qtype)
if len(targets) > 0 {
rrs = append(rrs, targets...)
......
......@@ -16,14 +16,3 @@ func SubTypeSignature(rrs []dns.RR, subtype uint16) []dns.RR {
}
return sigs
}
// CNAMEForType returns the RR that have the qtype from targets.
func CNAMEForType(rrs []dns.RR, qtype uint16) []dns.RR {
ret := []dns.RR{}
for _, target := range rrs {
if target.Header().Rrtype == qtype {
ret = append(ret, target)
}
}
return ret
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment