aboutsummaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorJim Huang <jserv@0xlab.org>2011-09-20 04:34:11 +0800
committerJim Huang <jserv@0xlab.org>2011-09-20 04:43:57 +0800
commit8a25e24c3fb2ebbcec4107d60d565ad524265e86 (patch)
tree5d4db95e1346d3d9c04c07f218c256b8dccc33b1 /libc
parent69d762d81468aec1b97b39498d0a5e83b05ff44b (diff)
downloadandroid_bionic-8a25e24c3fb2ebbcec4107d60d565ad524265e86.tar.gz
android_bionic-8a25e24c3fb2ebbcec4107d60d565ad524265e86.tar.bz2
android_bionic-8a25e24c3fb2ebbcec4107d60d565ad524265e86.zip
res_send: Avoid spurious close()s and (rare) failure
When looping over the current list of sockets we are connected to, use getpeername() not getsockname() to find out who the remote end is. This change avoids spurious close() and (rare) failure. ISC bug #18625 and fixed in libbind 6.0 Change-Id: Ic2b84301a6b850afff5e1588d9fdcca944eb2ae6
Diffstat (limited to 'libc')
-rw-r--r--libc/netbsd/resolv/res_send.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/netbsd/resolv/res_send.c b/libc/netbsd/resolv/res_send.c
index 696f8cfeb..94ba9693f 100644
--- a/libc/netbsd/resolv/res_send.c
+++ b/libc/netbsd/resolv/res_send.c
@@ -413,7 +413,7 @@ res_nsend(res_state statp,
if (EXT(statp).nssocks[ns] == -1)
continue;
peerlen = sizeof(peer);
- if (getsockname(EXT(statp).nssocks[ns],
+ if (getpeername(EXT(statp).nssocks[ns],
(struct sockaddr *)(void *)&peer, &peerlen) < 0) {
needclose++;
break;