Commit 2af97477 authored by Nicolas Owens's avatar Nicolas Owens Committed by Brad Fitzpatrick

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
parent e8fbd4af
...@@ -224,10 +224,10 @@ func lookupNS(name string) (ns []*NS, err error) { ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment