1
0
mirror of https://github.com/golang/go synced 2024-09-24 23:20:12 -06:00

net: fix LookupNS on Plan 9

use correct field count when resolving nameservers via /net/dns on Plan 9.

we incorrectly check for 4 fields instead of 3 when parsing the result of /net/dns, and get no results

R=golang-dev, ality
CC=golang-dev
https://golang.org/cl/10182044
This commit is contained in:
Nicolas Owens 2013-06-17 11:38:07 -07:00 committed by Brad Fitzpatrick
parent e8fbd4affb
commit 2af974777d

View File

@ -224,10 +224,10 @@ func lookupNS(name string) (ns []*NS, err error) {
}
for _, line := range lines {
f := getFields(line)
if len(f) < 4 {
if len(f) < 3 {
continue
}
ns = append(ns, &NS{f[3]})
ns = append(ns, &NS{f[2]})
}
return
}