File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
clickhouse-http-client/src/main/java/com/clickhouse/client/http Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,15 @@ private static HostNameAndAddress getLocalHost() {
4848 try {
4949 Enumeration <NetworkInterface > networkInterfaces = NetworkInterface .getNetworkInterfaces ();
5050
51+ outer :
5152 for (NetworkInterface ni : Collections .list (networkInterfaces )) {
5253 Enumeration <InetAddress > inetAddresses = ni .getInetAddresses ();
5354 for (InetAddress ia : Collections .list (inetAddresses )) {
5455 // We just use the first non-loopback address
55- if (!ia .isLoopbackAddress ()) {
56+ if (!ia .isLoopbackAddress () && ! ia . isLinkLocalAddress () ) {
5657 hostNameAndAddress .address = ia .getHostAddress ();
5758 hostNameAndAddress .hostName = ia .getCanonicalHostName ();
58- break ;
59+ break outer ;
5960 }
6061 }
6162 }
You can’t perform that action at this time.
0 commit comments