From 8ea75675f687559ad1cd96b6947320e409a54d3a Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 31 Aug 2011 03:51:49 +1200 Subject: [PATCH] Cleanup: make IP address show AnyAddr() as v4 or v6 --- src/ip/Address.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.47.3