summaryrefslogtreecommitdiffhomepage
path: root/app/tools/wireguard-go
diff options
context:
space:
mode:
authorZhao Gang <gang.zhao.42@gmail.com>2018-08-13 23:12:42 +0800
committerJason A. Donenfeld <Jason@zx2c4.com>2018-08-16 12:08:09 -0700
commit61d4f17f5deb76b9e8a26fc125562c7f621d65d9 (patch)
tree20f6fc0ea5231489771c0854ab8ab27ae9d1bc76 /app/tools/wireguard-go
parent09cf73cd3c0f37d178aa681023507b41ccb7f61f (diff)
config: fix wrong Peer endpoint string format
When a tunnel is running, saving the tunnel's config with an IPv6 address endpoint like [::1]:42 would result in the wrong format ::1:42. This patch fixes it. For endpoints with an IPv6 address(e.g. [::1]:42). Since the default endpoint InetSocketAddress is created unresolved, getEndpointString() returns "[::1]:42" (InetSocketAddress.getHostString() returns the literal hostname). After the endpoint is resolved, getEndpointString() returns "::1:42" (InetSocketAddress.getHostString() returns the IPv6 address without the square brackets). This inconsistent return values caused the above mentioned bug. With this patch, function getEndpointString would return the right format string whether the endpoint is resolved or not. Signed-off-by: Zhao Gang <gang.zhao.42@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/tools/wireguard-go')
0 files changed, 0 insertions, 0 deletions