]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Enable IpAddress debugs. remove unused method
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 16 Aug 2009 12:21:57 +0000 (00:21 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 16 Aug 2009 12:21:57 +0000 (00:21 +1200)
src/ip/IpAddress.cc
src/ip/IpAddress.h

index 997e49b4e672f8de1315094de3d981586a37c6d3..bfb0a11c78b85fe06c83e5ccd39eb02f202152f2 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "config.h"
 #include "ip/IpAddress.h"
+#include "Debug.h"
 #include "util.h"
 
 
 #error "INET6 defined but has been deprecated! Try running bootstrap and configure again."
 #endif
 
-/* We want to use the debug routines when running as module of squid. */
-/* otherwise fallback to printf if those are not available. */
-#ifndef SQUID_DEBUG
-#    define debugs(a,b,c)        //  drop.
-#else
-#warning "IpAddress built with Debugs!!"
-#    include "../src/Debug.h"
-#endif
-
 #if !USE_IPV6
 //  So there are some places where I will drop to using Macros too.
 //  At least I can restrict them to this file so they don't corrupt the app with C code.
@@ -178,9 +170,6 @@ const int IpAddress::ApplyMask(IpAddress const &mask_addr)
         p1[i] &= p2[i];
     }
 
-    /* we have found a situation where mask forms or destroys a IPv4 map. */
-    check4Mapped();
-
     return changes;
 }
 
@@ -544,9 +533,6 @@ IpAddress& IpAddress::operator =(struct sockaddr_in const &s)
     memcpy(&m_SocketAddr, &s, sizeof(struct sockaddr_in));
 #endif
 
-    /* maintain stored family values properly */
-    check4Mapped();
-
     return *this;
 };
 
@@ -567,12 +553,6 @@ IpAddress& IpAddress::operator =(const struct sockaddr_storage &s)
     return *this;
 };
 
-void IpAddress::check4Mapped()
-{
-    // obsolete.
-    // TODO use this NOW to set the sin6_family properly on exporting. not on import.
-}
-
 #if USE_IPV6
 IpAddress::IpAddress(struct sockaddr_in6 const &s)
 {
@@ -583,9 +563,6 @@ IpAddress::IpAddress(struct sockaddr_in6 const &s)
 IpAddress& IpAddress::operator =(struct sockaddr_in6 const &s)
 {
     memcpy(&m_SocketAddr, &s, sizeof(struct sockaddr_in6));
-
-    /* maintain address family properly */
-    check4Mapped();
     return *this;
 };
 
@@ -602,16 +579,9 @@ IpAddress& IpAddress::operator =(struct in_addr const &s)
 #if USE_IPV6
     Map4to6((const in_addr)s, m_SocketAddr.sin6_addr);
     m_SocketAddr.sin6_family = AF_INET6;
-
 #else
-
     memcpy(&m_SocketAddr.sin_addr, &s, sizeof(struct in_addr));
-
 #endif
-
-    /* maintain stored family type properly */
-    check4Mapped();
-
     return *this;
 };
 
@@ -625,13 +595,8 @@ IpAddress::IpAddress(struct in6_addr const &s)
 
 IpAddress& IpAddress::operator =(struct in6_addr const &s)
 {
-
     memcpy(&m_SocketAddr.sin6_addr, &s, sizeof(struct in6_addr));
     m_SocketAddr.sin6_family = AF_INET6;
-
-    /* maintain address family type properly */
-    check4Mapped();
-
     return *this;
 };
 
index 635cdad4020d624134cf291fa5276e2146452095..df6ee8dd564d759ee24b1d934d302f82a5bfceed 100644 (file)
@@ -390,8 +390,6 @@ private:
 
     bool GetReverseString4(char buf[MAX_IPSTRLEN], const struct in_addr &dat) const;
 
-    void check4Mapped();
-
 #if USE_IPV6
 
     bool GetReverseString6(char buf[MAX_IPSTRLEN], const struct in6_addr &dat) const;