]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Drop special localhost conversion.
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 06:24:58 +0000 (19:24 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 06:24:58 +0000 (19:24 +1300)
This was done as an experiment. It's now an RFC violation.
With no known uses it can easily die.

configure.in
src/external_acl.cc
src/ip/IpAddress.cc
src/win32.cc

index 8b4abfd3a96a39089aaea5d367e1cebc5c76a461..fbaa2cc827e111067e867bde5f18890e2dd9ea56 100644 (file)
@@ -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
 
index ff662efcb9574c7217379ad2258a8e1f286db028..1585ba65f422820b5959bebe286b89c121e1a718 100644 (file)
@@ -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 );
             }
index f9f3a174499412486e1a79bc6672da359a80652f..df001986e56c0c0386c5372cae762c2149c6d5b4 100644 (file)
@@ -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
index 37f81b6aaf7599f0c02c637c593a700a4be3a652..46f67d89dd1f5d327e1b3081c5eb6336a5bde4a2 100644 (file)
@@ -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;