diff options
author | Adam Mitz <mitza@ociweb.com> | 2017-03-29 14:30:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-29 14:30:04 -0500 |
commit | 339ec15c5c23f352a1bc2779f48828ec466942a1 (patch) | |
tree | c1feace0f3c7b4196772dc20cda9fb4a8510ef31 | |
parent | d5e740f32afc29339dc44b2d88e302d07a2c5264 (diff) | |
parent | 8eb07a10571eb342755f4036424b0724f9eb407c (diff) | |
download | ATCD-339ec15c5c23f352a1bc2779f48828ec466942a1.tar.gz |
Merge pull request #382 from huangminghuang/master
Fix INET_Addr reset IPV6 port problem
-rw-r--r-- | ACE/ace/INET_Addr.cpp | 1 | ||||
-rw-r--r-- | ACE/tests/INET_Addr_Test.cpp | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/ACE/ace/INET_Addr.cpp b/ACE/ace/INET_Addr.cpp index cf25f94196e..a9b3649142d 100644 --- a/ACE/ace/INET_Addr.cpp +++ b/ACE/ace/INET_Addr.cpp @@ -364,7 +364,6 @@ ACE_INET_Addr::set (u_short port_number, } this->reset_i (); - ACE_OS::memset (&this->inet_addr_, 0, sizeof this->inet_addr_); #if defined ACE_HAS_IPV6 && defined ACE_USES_IPV4_IPV6_MIGRATION if (address_family == AF_UNSPEC && !ACE::ipv6_enabled ()) diff --git a/ACE/tests/INET_Addr_Test.cpp b/ACE/tests/INET_Addr_Test.cpp index 0910a62b24a..8a19edf47ad 100644 --- a/ACE/tests/INET_Addr_Test.cpp +++ b/ACE/tests/INET_Addr_Test.cpp @@ -387,6 +387,20 @@ int run_main (int, ACE_TCHAR *[]) #if defined (ACE_HAS_IPV6) if (ACE::ipv6_enabled ()) { + { + ACE_INET_Addr addr; + int old_type = addr.get_type(); + addr.set(12345); + if (addr.get_type() != old_type) { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("IPv6 set failed: before addr.set(1234), addr.type() = %d\n") + ACE_TEXT (" after addr.set(1234), addr.type() = %d\n"), + old_type, + addr.get_type ())); + status = 1; + } + } + const char *ipv6_addresses[] = { "1080::8:800:200c:417a", // unicast address "ff01::101", // multicast address |