From a7ffb0db6993f217000d48c169f71145217b59db Mon Sep 17 00:00:00 2001 From: Henrik Nordstrom Date: Sun, 28 Feb 2010 22:24:17 +0100 Subject: [PATCH] Correct IPv4-mapped prefix, broken in rev 9865 Use POSIX tests for IPv6 address detections. --- src/ip/IpAddress.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ); -- 2.47.3