summaryrefslogtreecommitdiff
path: root/ace/INET_Addr.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-11-07 07:37:25 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-11-07 07:37:25 +0000
commitc52c508239c395e9a4f30285bb308c14a90e2595 (patch)
treeccdfa1209f9f9fde5a031792ad96667e2e339e05 /ace/INET_Addr.cpp
parent77e5f9a82914fe768602cce4eed698faac414a64 (diff)
downloadATCD-c52c508239c395e9a4f30285bb308c14a90e2595.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/INET_Addr.cpp')
-rw-r--r--ace/INET_Addr.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index 36ad5bca409..bd7bff4a61d 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -66,7 +66,8 @@ ACE_INET_Addr::ACE_INET_Addr (void)
: ACE_Addr (AF_INET, sizeof this->inet_addr_)
{
// ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
- (void) ACE_OS::memset ((void *) &this->inet_addr_, 0,
+ (void) ACE_OS::memset ((void *) &this->inet_addr_,
+ 0,
sizeof this->inet_addr_);
}
@@ -74,10 +75,19 @@ int
ACE_INET_Addr::set (const ACE_INET_Addr &sa)
{
ACE_TRACE ("ACE_INET_Addr::set");
- this->ACE_Addr::base_set (AF_INET, sizeof this->inet_addr_);
- (void) ACE_OS::memcpy ((void *) &this->inet_addr_,
- (void *) &sa.inet_addr_,
- sizeof this->inet_addr_);
+
+ this->ACE_Addr::base_set (sa.get_type (), sa.get_size ());
+
+ if (sa.get_type () == AF_ANY)
+ // Ugh, this is really a base class, so don't copy it.
+ (void) ACE_OS::memset ((void *) &this->inet_addr_,
+ 0,
+ sizeof this->inet_addr_);
+ else
+ // It's ok to make the copy.
+ (void) ACE_OS::memcpy ((void *) &this->inet_addr_,
+ (void *) &sa.inet_addr_,
+ sizeof this->inet_addr_);
return 0;
}