diff options
author | Adam Mitz <mitza@ociweb.com> | 2015-11-09 13:11:27 -0600 |
---|---|---|
committer | Adam Mitz <mitza@ociweb.com> | 2015-11-09 13:11:27 -0600 |
commit | 6008d58edcaffd00ea595b2bfa30d0c5bb618d66 (patch) | |
tree | 1c2f7474cc86dbeb9e9ecc55dd088f2d46a4552f /ACE | |
parent | 91122f6a6236f5422b1034faac1569498cbc05a9 (diff) | |
download | ATCD-6008d58edcaffd00ea595b2bfa30d0c5bb618d66.tar.gz |
Fixed bugs in ACE_OS::getaddrinfo_emulation.
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ace/OS_NS_netdb.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ACE/ace/OS_NS_netdb.cpp b/ACE/ace/OS_NS_netdb.cpp index d2600b84418..aa3eaeaa871 100644 --- a/ACE/ace/OS_NS_netdb.cpp +++ b/ACE/ace/OS_NS_netdb.cpp @@ -11,6 +11,7 @@ #include "ace/os_include/net/os_if.h" #include "ace/Global_Macros.h" +#include "ace/OS_NS_arpa_inet.h" #include "ace/OS_NS_stdlib.h" #include "ace/OS_NS_stropts.h" #include "ace/OS_NS_sys_socket.h" @@ -385,13 +386,24 @@ ACE_OS::getaddrinfo_emulation (const char *name, addrinfo **result) return EAI_AGAIN; case NO_RECOVERY: return EAI_FAIL; + case ENOTSUP: + if (ACE_OS::inet_aton (name, (in_addr *) &buffer[0]) != 0) + { + host = &entry; + entry.h_length = sizeof (in_addr); + entry.h_addr_list = (char **) (buffer + sizeof (in_addr)); + entry.h_addr_list[0] = buffer; + entry.h_addr_list[1] = 0; + break; + } + // fall-through default: errno = herr; return EAI_SYSTEM; } size_t n = 0; - for (char **addr = host->h_addr_list; addr; ++addr, ++n) /*empty*/; + for (char **addr = host->h_addr_list; *addr; ++addr, ++n) /*empty*/; # ifdef ACE_HAS_ALLOC_HOOKS ACE_Allocator *const al = ACE_Allocator::instance (); @@ -467,7 +479,7 @@ ACE_OS::getnameinfo_emulation (const sockaddr *saddr, ACE_SOCKET_LEN saddr_len, if (hp == 0 || hp->h_name == 0) return EAI_NONAME; - if (ACE_OS::strlen (hp->h_name) >= host_len) + if (ACE_OS::strlen (hp->h_name) >= size_t (host_len)) { if (host_len > 0) { |