If an IPAddress is initialized as following: Poco::Net::IPAddress ip("::")
ip.toString() returns "::0.0.0.0" whereas "::" is expected.
Using this output to create an IPAddress Poco::Net::IPAddress ip("::0.0.0.0") returns "Invalid address: ::0.0.0.0".
Even though both :: and ::0.0.0.0 are valid IPv6 addresses I would suggest to add a check in IPAddressImpl.cpp IPv6AddressImpl::toString() Line 435 if the IPv4 Address that follows :: is not in 0.0.0.0/8 or 0.0.0.0/32 to keep in and output consistent.
Like:
if(bytes[12] != 0){
NumberFormatter::append(result, bytes[12]);
result.append(".");
NumberFormatter::append(result, bytes[13]);
result.append(".");
NumberFormatter::append(result, bytes[14]);
result.append(".");
NumberFormatter::append(result, bytes[15]);
}
If an IPAddress is initialized as following:
Poco::Net::IPAddress ip("::")ip.toString()returns "::0.0.0.0" whereas "::" is expected.Using this output to create an IPAddress
Poco::Net::IPAddress ip("::0.0.0.0")returns "Invalid address: ::0.0.0.0".Even though both
::and::0.0.0.0are valid IPv6 addresses I would suggest to add a check in IPAddressImpl.cpp IPv6AddressImpl::toString() Line 435 if the IPv4 Address that follows::is not in 0.0.0.0/8 or 0.0.0.0/32 to keep in and output consistent.Like: