From: Amos Jeffries Date: Mon, 2 Feb 2009 06:24:58 +0000 (+1300) Subject: Drop special localhost conversion. X-Git-Tag: SQUID_3_1_0_5~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ca227e6d618daedf7715cf7aed09cfbf60b78ba;p=thirdparty%2Fsquid.git Drop special localhost conversion. This was done as an experiment. It's now an RFC violation. With no known uses it can easily die. --- diff --git a/configure.in b/configure.in index 8b4abfd3a9..fbaa2cc827 100644 --- a/configure.in +++ b/configure.in @@ -2029,18 +2029,6 @@ AC_ARG_WITH(ipv6-split-stack, [AC_DEFINE(IPV6_SPECIAL_SPLITSTACK, 0, [Enable support for IPv6 on split-stack implementations]) AC_MSG_RESULT(no)] ) -dnl Check for IPv6-localhost option -AC_MSG_CHECKING([for IPv6-Localhost requirement]) -AC_ARG_WITH(localhost-ipv6, - AC_HELP_STRING([--with-localhost-ipv6], - [WARNING: This is an RFC violation! - Treat 127.0.0.1 and ::1 as identical and convert all inputs of localhost to ::1. - This depends on IPv6 support and all applications squid contacts - via localhost being IPv6 enabled.]), - [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 1, [Convert IPv4-localhost requests to IPv6. Default: keep seperate.]) AC_MSG_RESULT(yes)], - [AC_DEFINE(IPV6_SPECIAL_LOCALHOST, 0, [Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_MSG_RESULT(no)] -) - dnl Check whether this OS defines sin6_len as a member of sockaddr_in6 as a backup to ss_len AC_CACHE_CHECK([for sin6_len field in struct sockaddr_in6], ac_cv_have_sin6_len_in_struct_sai, [ @@ -2066,7 +2054,6 @@ else AC_MSG_WARN([IPv6 is not available on this system.]) AC_DEFINE(USE_IPV6,0,[Enable support for IPv6]) AC_DEFINE(IPV6_SPECIAL_SPLITSTACK,0,[Enable support for IPv6 on split-stack implementations]) - AC_DEFINE(IPV6_SPECIAL_LOCALHOST,0,[Convert IPv4-localhost requests to IPv6. Default: Keep seperate.]) AC_DEFINE(IPV6_SPECIAL_V4MAPPED,0,[Enable v4-mapping through v6 sockets]) fi diff --git a/src/external_acl.cc b/src/external_acl.cc index ff662efcb9..1585ba65f4 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -329,9 +329,6 @@ parse_externalAclHelper(external_acl ** list) /* INET6: allow admin to configure some helpers explicitly to bind to IPv4/v6 localhost port. */ } else if (strcmp(token, "ipv4") == 0) { -#if IPV6_SPECIAL_LOCALHOST - debugs(3, 0, "WARNING: --with-localhost-ipv6 conflicts with external ACL helper to using IPv4: " << a->name ); -#endif if ( !a->local_addr.SetIPv4() ) { debugs(3, 0, "WARNING: Error converting " << a->local_addr << " to IPv4 in " << a->name ); } diff --git a/src/ip/IpAddress.cc b/src/ip/IpAddress.cc index f9f3a17449..df001986e5 100644 --- a/src/ip/IpAddress.cc +++ b/src/ip/IpAddress.cc @@ -247,9 +247,6 @@ bool IpAddress::IsIPv4() const #if USE_IPV6 return IsAnyAddr() || IsNoAddr() || -#if IPV6_SPECIAL_LOCALHOST - IsLocalhost() || -#endif ( m_SocketAddr.sin6_addr.s6_addr32[0] == htonl(0x00000000) && m_SocketAddr.sin6_addr.s6_addr32[1] == htonl(0x00000000) && m_SocketAddr.sin6_addr.s6_addr32[2] == htonl(0x0000FFFF) @@ -265,9 +262,6 @@ bool IpAddress::IsIPv6() const #if USE_IPV6 return IsAnyAddr() || IsNoAddr() || -#if IPV6_SPECIAL_LOCALHOST - IsLocalhost() || -#endif !( m_SocketAddr.sin6_addr.s6_addr32[0] == htonl(0x00000000) && m_SocketAddr.sin6_addr.s6_addr32[1] == htonl(0x00000000) && m_SocketAddr.sin6_addr.s6_addr32[2] == htonl(0x0000FFFF) @@ -311,13 +305,11 @@ bool IpAddress::SetIPv4() { #if USE_IPV6 -#if !IPV6_SPECIAL_LOCALHOST if ( IsLocalhost() ) { m_SocketAddr.sin6_addr.s6_addr32[2] = htonl(0xffff); m_SocketAddr.sin6_addr.s6_addr32[3] = htonl(0x7F000001); return true; } -#endif if ( IsAnyAddr() ) { m_SocketAddr.sin6_addr.s6_addr32[2] = htonl(0xffff); @@ -342,15 +334,12 @@ bool IpAddress::IsLocalhost() const && m_SocketAddr.sin6_addr.s6_addr32[2] == 0 && m_SocketAddr.sin6_addr.s6_addr32[3] == htonl(0x1) ) -#if !IPV6_SPECIAL_LOCALHOST || ( m_SocketAddr.sin6_addr.s6_addr32[0] == 0 && m_SocketAddr.sin6_addr.s6_addr32[1] == 0 && m_SocketAddr.sin6_addr.s6_addr32[2] == htonl(0xffff) && m_SocketAddr.sin6_addr.s6_addr32[3] == htonl(0x7F000001) - ) -#endif - ; + ); #else return (htonl(0x7F000001) == m_SocketAddr.sin_addr.s_addr); @@ -1173,14 +1162,6 @@ void IpAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const { out.s6_addr32[2] = 0xFFFFFFFF; out.s6_addr32[3] = 0xFFFFFFFF; -#if IPV6_SPECIAL_LOCALHOST - } else if ( in.s_addr == htonl(0x7F000001)) { - /* LOCALHOST */ - - memset(&out, 0, sizeof(struct in6_addr)); - out.s6_addr32[3] = htonl(0x1); -#endif - } else { /* general */ @@ -1197,15 +1178,6 @@ void IpAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const { memset(&out, 0, sizeof(struct in_addr)); out.s_addr = in.s6_addr32[3]; - -#if IPV6_SPECIAL_LOCALHOST - /* LOCALHOST */ - - if ( IsLocalhost() ) { - out.s_addr = htonl(0x7F000001); - } -#endif - } #endif diff --git a/src/win32.cc b/src/win32.cc index 37f81b6aaf..46f67d89dd 100644 --- a/src/win32.cc +++ b/src/win32.cc @@ -62,13 +62,11 @@ int WIN32_pipe(int handles[2]) localhost.SetLocalhost(); -#if !IPV6_SPECIAL_LOCALHOST /* INET6: back-compatible: localhost pipes default to IPv4 unless set otherwise. * it is blocked by untested helpers on many admins configs * if this proves to be wrong it can die easily. */ localhost.SetIPv4(); -#endif handles[0] = handles[1] = -1;