aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-08-22 04:04:55 +0000
committerUlrich Drepper <drepper@redhat.com>2005-08-22 04:04:55 +0000
commite2a99d8e1fb78ea428641ffa51ae68188cc77b6a (patch)
tree57fbd2722ca99980fb7b2d9e55b3a50c4388abc8
parent9fc42dfdc179691ac229ea81b5a20984d8c0ef85 (diff)
downloadglibc-cvs/fedora-glibc-20050822T0727.zip
glibc-cvs/fedora-glibc-20050822T0727.tar.gz
glibc-cvs/fedora-glibc-20050822T0727.tar.bz2
* resolv/res_send.c (Aerror): Fix printing IP address.cvs/fedora-glibc-20050822T0727
-rw-r--r--ChangeLog2
-rw-r--r--resolv/res_send.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index de698d3..2d86dca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2005-08-21 Ulrich Drepper <drepper@redhat.com>
+ * resolv/res_send.c (Aerror): Fix printing IP address.
+
* resolv/res_send.c (send_vc): Pass correct sockaddr size to connect.
2005-08-19 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 86c4f1e..e62cde2 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1062,8 +1062,13 @@ Aerror(const res_state statp, FILE *file, const char *string, int error,
fprintf(file, "res_send: %s ([%s].%u): %s\n",
string,
- inet_ntop(address->sa_family, address->sa_data,
- tmp, sizeof tmp),
+ (address->sa_family == AF_INET
+ ? inet_ntop(address->sa_family,
+ &((const struct sockaddr_in *) address)->sin_addr,
+ tmp, sizeof tmp)
+ : inet_ntop(address->sa_family,
+ &((const struct sockaddr_in6 *) address)->sin6_addr,
+ tmp, sizeof tmp)),
(address->sa_family == AF_INET
? ntohs(((struct sockaddr_in *) address)->sin_port)
: address->sa_family == AF_INET6