diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-01 17:54:47 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-01 17:54:47 +0200 |
commit | 91647978e69000e223c5f1daef89ad3d8e4ce66e (patch) | |
tree | 7e957baaaf3f3ba9efa75fd4410ae2e2308085e0 /app/src/main/java/com | |
parent | d0b64f4bd59a9cdab810196e5a88fdc0dbaedb8f (diff) |
Fix small error
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com')
-rw-r--r-- | app/src/main/java/com/wireguard/config/InetEndpoint.java | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |