summaryrefslogtreecommitdiffstats
path: root/zkfacade
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-11-11 15:37:04 +0100
committerJon Bratseth <bratseth@yahoo-inc.com>2016-11-11 15:37:04 +0100
commit9c98f68b133a514f2cc501315f130d7e3e4ec76c (patch)
treeedb56f34f3cdbec3c0017930587b53070bd62f20 /zkfacade
parentdda9ca0f3b0f677b205a54cf2d99261305154425 (diff)
Allow the name of localhost
Diffstat (limited to 'zkfacade')
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java b/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java
index d9c85f0cd1b..4c30e125d74 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/zookeeper/RestrictedServerCnxnFactory.java
@@ -1,6 +1,7 @@
package com.yahoo.vespa.zookeeper;
import com.google.common.collect.ImmutableSet;
+import com.yahoo.net.HostName;
import org.apache.zookeeper.server.NIOServerCnxn;
import org.apache.zookeeper.server.NIOServerCnxnFactory;
@@ -9,9 +10,7 @@ import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.util.HashSet;
-import java.util.Optional;
import java.util.Set;
-import java.util.logging.Level;
import java.util.logging.Logger;
/**
@@ -67,6 +66,7 @@ public class RestrictedServerCnxnFactory extends NIOServerCnxnFactory {
private boolean isLocalHost(String remoteHost) {
if (remoteHost.equals("localhost")) return true;
if (remoteHost.equals("localhost.localdomain")) return true;
+ if (remoteHost.equals(HostName.getLocalhost())) return true;
return false;
}