From: Henrik Nordstrom Date: Sun, 28 Feb 2010 21:24:17 +0000 (+0100) Subject: Correct IPv4-mapped prefix, broken in rev 9865 Use POSIX tests for IPv6 address detec... X-Git-Tag: SQUID_3_1_0_18~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7ffb0db6993f217000d48c169f71145217b59db;p=thirdparty%2Fsquid.git Correct IPv4-mapped prefix, broken in rev 9865 Use POSIX tests for IPv6 address detections. --- diff --git a/src/ip/IpAddress.cc b/src/ip/IpAddress.cc index 5259669c44..75c8d97bd2 100644 --- a/src/ip/IpAddress.cc +++ b/src/ip/IpAddress.cc @@ -295,10 +295,10 @@ bool IpAddress::SetIPv4() { #if USE_IPV6 static const struct in6_addr v4_localhost = {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01 }} + 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01 }} }; static const struct in6_addr v4_any = {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }} + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }} }; if ( IsLocalhost() ) { @@ -325,7 +325,7 @@ bool IpAddress::IsLocalhost() const { #if USE_IPV6 static const struct in6_addr v4_localhost = {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01 }} + 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01 }} }; return IN6_IS_ADDR_LOOPBACK( &m_SocketAddr.sin6_addr ) || IN6_ARE_ADDR_EQUAL( &m_SocketAddr.sin6_addr, &v4_localhost );