You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2019/04/04 17:52:37 UTC
[geode] branch develop updated: GEODE-6580: Corrects loop break.
This is an automated email from the ASF dual-hosted git repository.
jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 5a70f14 GEODE-6580: Corrects loop break.
5a70f14 is described below
commit 5a70f144c67d835b1ee58811cdecdce7db443ca4
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Thu Apr 4 10:49:21 2019 -0700
GEODE-6580: Corrects loop break.
---
.../src/main/java/org/apache/geode/internal/net/SocketCreator.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
index f03acae..bb0576c 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
@@ -190,8 +190,9 @@ public class SocketCreator {
// try to find a non-loopback address
Set<InetAddress> myInterfaces = getMyAddresses();
boolean preferIPv6 = SocketCreator.useIPv6Addresses;
+ String lhName = null;
for (InetAddress addr : myInterfaces) {
- if (addr.isLoopbackAddress() || addr.isAnyLocalAddress()) {
+ if (addr.isLoopbackAddress() || addr.isAnyLocalAddress() || lhName != null) {
break;
}
boolean ipv6 = addr instanceof Inet6Address;
@@ -200,10 +201,10 @@ public class SocketCreator {
String addrName = reverseDNS(addr);
if (inetAddress.isLoopbackAddress()) {
inetAddress = addr;
- break;
+ lhName = addrName;
} else if (addrName != null) {
inetAddress = addr;
- break;
+ lhName = addrName;
}
} else {
if (preferIPv6 && ipv4 && ipv4Fallback == null) {