Skip to content

Commit

Permalink
Fix off-by-one error that made only two-level domains work
Browse files Browse the repository at this point in the history
  • Loading branch information
abh committed Aug 27, 2012
1 parent 9312930 commit 546871c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func readZoneFile(zoneName, fileName string) (*Zone, error) {

Zone := new(Zone)
Zone.Labels = make(labels)
Zone.LenLabels = dns.LenLabels(Zone.Origin)
Zone.Origin = zoneName
Zone.LenLabels = dns.LenLabels(Zone.Origin)

if err == nil {
var objmap map[string]interface{}
Expand Down
2 changes: 1 addition & 1 deletion serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func getQuestionName(z *Zone, req *dns.Msg) string {
lx := dns.SplitLabels(req.Question[0].Name)
ql := lx[0 : len(lx)-z.LenLabels-1]
ql := lx[0 : len(lx)-z.LenLabels]
return strings.Join(ql, ".")
}

Expand Down

0 comments on commit 546871c

Please sign in to comment.