Skip to content

Commit

Permalink
remove unused fn
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-stephens committed Aug 2, 2024
1 parent 04bb09e commit e1031a1
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/zdns/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package zdns

import (
"errors"
"fmt"
"net"
"strings"
Expand Down Expand Up @@ -56,37 +55,6 @@ func nameIsBeneath(name, layer string) (bool, string) {
return false, ""
}

func nextAuthority(name, layer string) (string, error) {
// We are our own authority for PTRs
// (This is dealt with elsewhere)
if strings.HasSuffix(name, "in-addr.arpa") && layer == "." {
return "in-addr.arpa", nil
}

idx := strings.LastIndex(name, ".")
if idx < 0 || (idx+1) >= len(name) {
return name, nil
}
if layer == "." {
return name[idx+1:], nil
}

if !strings.HasSuffix(name, layer) {
return "", errors.New("server did not provide appropriate resolvers to continue recursion")
}

// Limit the search space to the prefix of the string that isnt layer
idx = strings.LastIndex(name, layer) - 1
if idx < 0 || (idx+1) >= len(name) {
// Out of bounds. We are our own authority
return name, nil
}
// Find the next step in the layer
idx = strings.LastIndex(name[0:idx], ".")
next := name[idx+1:]
return next, nil
}

func checkGlue(server string, result SingleQueryResult) (SingleQueryResult, Status) {
for _, additional := range result.Additional {
ans, ok := additional.(Answer)
Expand Down

0 comments on commit e1031a1

Please sign in to comment.