From 0fbd74920750878a4a51d479de9e6b89ef8399b0 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sat, 16 Jun 2012 15:57:00 +0200 Subject: [PATCH] ipv6 update --- source/net/yacy/cora/protocol/Domains.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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