Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#618 Poco::Net::SocketAddress sa("0.0.0.0", 1234) creates IPv6 address

Platform_Specific
open
nobody
None
1
2013-08-16
2013-07-10
nj0y
No

Fix for Poco 1.5.2:

Index: IPAddress.cpp

--- IPAddress.cpp (revision 16450)
+++ IPAddress.cpp (revision 16451)
@@ -549,7 +549,7 @@
bool IPAddress::tryParse(const std::string& addr, IPAddress& result)
{
IPv4AddressImpl impl4(IPv4AddressImpl::parse(addr));
- if (impl4 != IPv4AddressImpl())
+ if (impl4 != IPv4AddressImpl() || addr.empty() || trim(addr) == "0.0.0.0")
{
result.newIPv4(impl4.addr());
return true;
@@ -556,7 +556,7 @@
}
#if defined(POCO_HAVE_IPv6)
IPv6AddressImpl impl6(IPv6AddressImpl::parse(addr));
- if (impl6 != IPv6AddressImpl())
+ if (impl6 != IPv6AddressImpl() || addr.empty() || trim(addr) == "::")
{
result.newIPv6(impl6.addr());
return true;

Discussion

  • alex-tightvnc
    alex-tightvnc
    2013-08-16

    Is this patch will be approved?
    When 1.5.2 final release is planned?