summaryrefslogtreecommitdiff
path: root/resolv/res_send.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-08-22 07:34:59 +0000
committerJakub Jelinek <jakub@redhat.com>2005-08-22 07:34:59 +0000
commit8b0a52444c889fd368f51ba37ad401b6ca5d40f1 (patch)
treee61c0a96c4f02a2ae41a4a6b8b291cd0adfa75be /resolv/res_send.c
parent964f44e4d838ce28ae848f228c7212cf609ace3c (diff)
Updated to fedora-glibc-20050822T0727
Diffstat (limited to 'resolv/res_send.c')
-rw-r--r--resolv/res_send.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 6f12b88d6f..e62cde2360 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -654,7 +654,9 @@ send_vc(res_state statp,
}
__set_errno (0);
if (connect(statp->_vcsock, (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
+ nsap->sin6_family == AF_INET
+ ? sizeof (struct sockaddr_in)
+ : sizeof (struct sockaddr_in6)) < 0) {
*terrno = errno;
Aerror(statp, stderr, "connect/vc", errno,
(struct sockaddr *) nsap);
@@ -1060,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