mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-20 23:36:18 +08:00
add brackets to local address string if ipv6
This commit is contained in:
parent
9e63c7e3bc
commit
f9873020a5
|
@ -77,6 +77,9 @@ func getPrivateAddr() (string, error) {
|
|||
if local == "" {
|
||||
err = errors.New("could not find local ip")
|
||||
}
|
||||
if net.ParseIP(local).To16() != nil {
|
||||
local = "[" + local + "]"
|
||||
}
|
||||
|
||||
return local, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue