mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 03:46:02 +08:00
Merge pull request #1542 from gravitl/bugfix_v0.15.2_private_ipv6_address
add brackets to local address string if ipv6
This commit is contained in:
commit
5b49d06953
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue