From: Amos Jeffries Date: Tue, 30 Aug 2011 15:51:49 +0000 (+1200) Subject: Cleanup: make IP address show AnyAddr() as v4 or v6 X-Git-Tag: take08~33^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ea75675f687559ad1cd96b6947320e409a54d3a;p=thirdparty%2Fsquid.git Cleanup: make IP address show AnyAddr() as v4 or v6 --- diff --git a/src/ip/Address.cc b/src/ip/Address.cc index d5095d88ac..5eed2fa61d 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -826,7 +826,10 @@ Ip::Address::NtoA(char* buf, const unsigned int blen, int force) const /* some external code may have blindly memset a parent. */ /* thats okay, our default is known */ if ( IsAnyAddr() ) { - memcpy(buf,"::\0", min(static_cast(3),blen)); + if (IsIPv6()) + memcpy(buf,"::\0", min(static_cast(3),blen)); + else if (IsIPv4()) + memcpy(buf,"0.0.0.0\0", min(static_cast(8),blen)); return buf; }