From: mturk Date: Tue, 16 May 2006 07:14:46 +0000 (+0000) Subject: Use APR_UNSPEC only if the provided address X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=016ba011a7471b5864d77a920ada12ce0b6c6735;p=tomcat7.0 Use APR_UNSPEC only if the provided address actually is the IPV6 address. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@406860 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 96a58a9c9..99a214010 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -561,8 +561,10 @@ public class AprEndpoint { addressStr = address.getHostAddress(); } int family = Socket.APR_INET; - if (Library.APR_HAVE_IPV6) - family= Socket.APR_UNSPEC; + if (Library.APR_HAVE_IPV6 && addressStr != null) { + if (addressStr.indexOf(':') >= 0) + family= Socket.APR_UNSPEC; + } long inetAddress = Address.info(addressStr, family, port, 0, rootPool); // Create the APR server socket