mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
empty non-terminal support
When looking for a name in tree, return wether we got to a longer one - if so we had an ent. Add tests + dnssec tests and refactor the tests as well a bit.
This commit is contained in:
@@ -6,10 +6,9 @@ import "github.com/miekg/dns"
|
||||
func (z *Zone) ClosestEncloser(rr dns.RR) string {
|
||||
// tree/tree.go does not store a parent *Node pointer, so we can't
|
||||
// just follow up the tree. TODO(miek): fix.
|
||||
|
||||
offset, end := dns.NextLabel(rr.Header().Name, 0)
|
||||
for !end {
|
||||
elem := z.Tree.Get(rr)
|
||||
elem, _ := z.Tree.Get(rr)
|
||||
if elem != nil {
|
||||
return elem.Name()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user