summaryrefslogtreecommitdiff
path: root/ares_getnameinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ares_getnameinfo.c')
-rw-r--r--ares_getnameinfo.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c
index 82e261d..5b9f638 100644
--- a/ares_getnameinfo.c
+++ b/ares_getnameinfo.c
@@ -22,9 +22,6 @@
# endif
#endif
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
@@ -47,17 +44,8 @@
#include <net/if.h>
#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "ares.h"
#include "ares_ipv6.h"
-#include "inet_ntop.h"
#include "ares_nowarn.h"
#include "ares_private.h"
@@ -188,7 +176,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
if (sa->sa_family == AF_INET)
{
niquery->family = AF_INET;
- memcpy(&niquery->addr.addr4, addr, sizeof(struct in_addr));
+ memcpy(&niquery->addr.addr4, addr, sizeof(niquery->addr.addr4));
ares_gethostbyaddr(channel, &addr->sin_addr,
sizeof(struct in_addr), AF_INET,
nameinfo_callback, niquery);
@@ -196,7 +184,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
else
{
niquery->family = AF_INET6;
- memcpy(&niquery->addr.addr6, addr6, sizeof(struct ares_in6_addr));
+ memcpy(&niquery->addr.addr6, addr6, sizeof(niquery->addr.addr6));
ares_gethostbyaddr(channel, &addr6->sin6_addr,
sizeof(struct ares_in6_addr), AF_INET6,
nameinfo_callback, niquery);