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:
Alex Feiszli 2022-09-12 11:40:02 -04:00 committed by GitHub
commit 5b49d06953
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}