mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-04 16:33:49 +08:00
add brackets to local address string if ipv6
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user