From: mturk Date: Tue, 3 Apr 2007 10:45:51 +0000 (+0000) Subject: Fix #41973 by not initializing IPV6 if address is null. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e67e6ad2a5a7a339d22cde6aec58d77116edbcb5;p=tomcat7.0 Fix #41973 by not initializing IPV6 if address is null. APR cannot listen both on IPV4 and IPV6 on some platforms (e.g BSD and Windows). git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@525132 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 59ee88848..0706804c4 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -587,6 +587,15 @@ public class AprEndpoint { addressStr = address.getHostAddress(); } int family = Socket.APR_INET; + if (Library.APR_HAVE_IPV6) { + if (addressStr == null) { + if (!OS.IS_BSD && !OS.IS_WIN32 && !OS.IS_WIN64) + family = Socket.APR_UNSPEC; + } else if (addressStr.indexOf(':') >= 0) { + family = Socket.APR_UNSPEC; + } + } + if (Library.APR_HAVE_IPV6 && (addressStr == null || addressStr.indexOf(':') >= 0)) { family = Socket.APR_UNSPEC; }