diff options
| author | Jim Huang <jserv@0xlab.org> | 2011-09-20 04:34:11 +0800 |
|---|---|---|
| committer | Jim Huang <jserv@0xlab.org> | 2011-09-20 04:43:57 +0800 |
| commit | 8a25e24c3fb2ebbcec4107d60d565ad524265e86 (patch) | |
| tree | 5d4db95e1346d3d9c04c07f218c256b8dccc33b1 /libc | |
| parent | 69d762d81468aec1b97b39498d0a5e83b05ff44b (diff) | |
| download | android_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.c | 2 |
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; |
