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() {
48
48
try {
49
49
Enumeration <NetworkInterface > networkInterfaces = NetworkInterface .getNetworkInterfaces ();
50
50
51
+ outer :
51
52
for (NetworkInterface ni : Collections .list (networkInterfaces )) {
52
53
Enumeration <InetAddress > inetAddresses = ni .getInetAddresses ();
53
54
for (InetAddress ia : Collections .list (inetAddresses )) {
54
55
// We just use the first non-loopback address
55
- if (!ia .isLoopbackAddress ()) {
56
+ if (!ia .isLoopbackAddress () && ! ia . isLinkLocalAddress () ) {
56
57
hostNameAndAddress .address = ia .getHostAddress ();
57
58
hostNameAndAddress .hostName = ia .getCanonicalHostName ();
58
- break ;
59
+ break outer ;
59
60
}
60
61
}
61
62
}
You can’t perform that action at this time.
0 commit comments