*
*/
-#include "config.h"
+#include "squid.h"
#include "compat/inet_ntop.h"
#include "compat/getaddrinfo.h"
#include "Debug.h"
bool
Ip::Address::IsAnyAddr() const
{
- return IN6_IS_ADDR_UNSPECIFIED( &m_SocketAddr.sin6_addr ) || IN6_ARE_ADDR_EQUAL( &m_SocketAddr.sin6_addr, &v4_anyaddr); ;
+ return IN6_IS_ADDR_UNSPECIFIED(&m_SocketAddr.sin6_addr) || IN6_ARE_ADDR_EQUAL(&m_SocketAddr.sin6_addr, &v4_anyaddr);
}
/// NOTE: Does NOT clear the Port stored. Ony the Address and Type.
/* some external code may have blindly memset a parent. */
/* thats okay, our default is known */
if ( IsAnyAddr() ) {
- memcpy(buf,"::\0", min(static_cast<unsigned int>(3),blen));
+ if (IsIPv6())
+ memcpy(buf,"::\0", min(static_cast<unsigned int>(3),blen));
+ else if (IsIPv4())
+ memcpy(buf,"0.0.0.0\0", min(static_cast<unsigned int>(8),blen));
return buf;
}