From f9873020a51dbb58cb28771ac19d059b07479407 Mon Sep 17 00:00:00 2001 From: "Matthew R. Kasun" Date: Mon, 12 Sep 2022 08:53:06 -0400 Subject: [PATCH] add brackets to local address string if ipv6 --- netclient/functions/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netclient/functions/common.go b/netclient/functions/common.go index 2c4b40ec..a8b23c80 100644 --- a/netclient/functions/common.go +++ b/netclient/functions/common.go @@ -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 }