Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

ipv6 update

Michael Peter Christen0fbd74920750
diff --git a/source/net/yacy/cora/protocol/Domains.java b/source/net/yacy/cora/protocol/Domains.java
index 4baf0020c..dadeb3005 100644
--- a/source/net/yacy/cora/protocol/Domains.java
+++ b/source/net/yacy/cora/protocol/Domains.java
@@ -663,7 +663,7 @@ public class Domains {
public static final InetAddress parseInetAddress(String ip) {
if (ip == null || ip.length() < 8) return null;
- if (ip.equals("0:0:0:0:0:0:0:1%0")) ip = "127.0.0.1";
+ if (isLocalhost(ip)) ip = "127.0.0.1";
final String[] ips = dotPattern.split(ip);
if (ips.length != 4) return null;
final byte[] ipb = new byte[4];
@@ -884,7 +884,9 @@ public class Domains {
return (noLocalCheck || // DO NOT REMOVE THIS! it is correct to return true if the check is off
"127.0.0.1".equals(host) ||
"localhost".equals(host) ||
- host.startsWith("0:0:0:0:0:0:0:1")
+ host.startsWith("0:0:0:0:0:0:0:1") ||
+ host.startsWith("::1/") ||
+ "::1".equals(host)
);
}
@@ -908,7 +910,7 @@ public class Domains {
// FIXME IPv4 only
// check local ip addresses
if (matchesList(host, INTRANET_PATTERNS)) return true;
- if (host.startsWith("0:0:0:0:0:0:0:1")) return true;
+ if (isLocalhost(host)) return true;
// check if there are other local IP addresses that are not in
// the standard IP range