Commit e53f7d89 authored by Russ Cox's avatar Russ Cox

net: put [ ] around IPv6 addresses for Dial

Update #538.

R=r
CC=golang-dev
https://golang.org/cl/229045
parent 74b131c0
......@@ -49,7 +49,11 @@ func _DNS_ReadConfig() (*_DNS_Config, os.Error) {
// just an IP address. Otherwise we need DNS
// to look it up.
name := f[1]
if len(ParseIP(name)) != 0 {
switch len(ParseIP(name)) {
case 16:
name = "[" + name + "]"
fallthrough
case 4:
a = a[0 : n+1]
a[n] = name
conf.servers = a
......
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