summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjha <jha@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-11 03:45:30 +0000
committerjha <jha@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-11 03:45:30 +0000
commitd3562e7f936e58b8055564d3f3294e42557d4df3 (patch)
tree96b3185fbd38c33ca5250adf6ec1a25e7f91863d
parentd4a6fe1dc94c232b1e54592aa6eb993f1cc900b8 (diff)
downloadATCD-d3562e7f936e58b8055564d3f3294e42557d4df3.tar.gz
Fixed get_ip_address. I was doing some really stupid calculations.
-rw-r--r--ace/INET_Addr.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index bb1cd823b1c..c1e079c8287 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -701,13 +701,11 @@ const char *
ACE_INET_Addr::get_host_addr (char *dst, int size) const
{
#if defined (ACE_HAS_IPV6)
- /*
if(IN6_IS_ADDR_V4MAPPED(&this->inet_addr_.sin6_addr)) {
ACE_UINT32 addr;
addr = this->get_ip_address();
return ACE_OS::inet_ntop (AF_INET, (const void*)&addr,dst,size);
}
- */
dst[0] = '[';
const char *ch = ACE_OS::inet_ntop (AF_INET6, (const void*)&this->inet_addr_.sin6_addr,dst+1,size-1);
if(ch == 0) {
@@ -747,7 +745,7 @@ ACE_INET_Addr::get_ip_address (void) const
ACE_UINT32 addr;
// Return the last 32 bits of the address
char *thisaddrptr = (char*)this->addr_pointer();
- thisaddrptr += 128 - 32;
+ thisaddrptr += 128/8 - 32/8;
memcpy((void*)&addr,(void*)(thisaddrptr),sizeof(addr));
return addr;
} else {