net.JoinHostPort will add [ and ]
dont do this in the clientconfig
This commit is contained in:
parent
35eaf9f14a
commit
3e3234c4ea
|
@ -50,13 +50,14 @@ func ClientConfigFromFile(conf string) (*ClientConfig, error) {
|
|||
// just an IP address. Otherwise we need DNS
|
||||
// to look it up.
|
||||
name := f[1]
|
||||
switch x := net.ParseIP(name); true {
|
||||
case x.To4() != nil:
|
||||
c.Servers = append(c.Servers, name)
|
||||
case x.To16() != nil:
|
||||
name = "[" + name + "]"
|
||||
c.Servers = append(c.Servers, name)
|
||||
}
|
||||
// Don't use this. net.JoinHostPort will fix this for you
|
||||
// switch x := net.ParseIP(name); true {
|
||||
// case x.To4() != nil:
|
||||
// c.Servers = append(c.Servers, name)
|
||||
// case x.To16() != nil:
|
||||
// name = "[" + name + "]"
|
||||
c.Servers = append(c.Servers, name)
|
||||
// }
|
||||
}
|
||||
|
||||
case "domain": // set search path to just this domain
|
||||
|
|
Loading…
Reference in New Issue