diff --git a/src/pkg/net/lookup_plan9.go b/src/pkg/net/lookup_plan9.go index 723f29ffce1..2ccd997c2cb 100644 --- a/src/pkg/net/lookup_plan9.go +++ b/src/pkg/net/lookup_plan9.go @@ -123,6 +123,7 @@ func lookupHost(host string) (addrs []string, err error) { if err != nil { return } +loop: for _, line := range lines { f := getFields(line) if len(f) < 2 { @@ -135,6 +136,12 @@ func lookupHost(host string) (addrs []string, err error) { if ParseIP(addr) == nil { continue } + // only return unique addresses + for _, a := range addrs { + if a == addr { + continue loop + } + } addrs = append(addrs, addr) } return