mirror of
https://github.com/golang/go
synced 2024-11-12 05:40:22 -07: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:
parent
e8fbd4affb
commit
2af974777d
@ -224,10 +224,10 @@ func lookupNS(name string) (ns []*NS, err error) {
|
|||||||
}
|
}
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
f := getFields(line)
|
f := getFields(line)
|
||||||
if len(f) < 4 {
|
if len(f) < 3 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ns = append(ns, &NS{f[3]})
|
ns = append(ns, &NS{f[2]})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user