From a9fd71cbcb6ea4b9123db4d0dbab5712b221ce2a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 1 Oct 2018 17:54:47 +0200 Subject: Fix small error --- app/src/main/java/com/wireguard/config/InetEndpoint.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/com/wireguard/config/InetEndpoint.java b/app/src/main/java/com/wireguard/config/InetEndpoint.java index 4896ee97..3efe4203 100644 --- a/app/src/main/java/com/wireguard/config/InetEndpoint.java +++ b/app/src/main/java/com/wireguard/config/InetEndpoint.java @@ -11,6 +11,7 @@ import com.wireguard.android.Application; import com.wireguard.android.R; import java.net.Inet4Address; +import java.net.Inet6Address; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; @@ -59,7 +60,7 @@ public class InetEndpoint { if (resolvedHost == null) resolvedHost = candidates[0]; } - return String.format(resolvedHost instanceof Inet4Address ? + return String.format(resolvedHost instanceof Inet6Address ? "[%s]:%d" : "%s:%d", resolvedHost.getHostAddress(), port); } -- cgit v1.2.3