summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:31:46 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:32:56 +0100
commit3c67ca0e9eedd2db2d5b6c052935fbe43d140703 (patch)
tree6d639d18f4e8f3ead81a8c9771730b356b4a54dd
parent999ace2a21cd6793d3502321ab0fd961e8c80f65 (diff)
downloadsocket_wrapper-3c67ca0e9eedd2db2d5b6c052935fbe43d140703.zip
socket_wrapper-3c67ca0e9eedd2db2d5b6c052935fbe43d140703.tar.gz
socket_wrapper-3c67ca0e9eedd2db2d5b6c052935fbe43d140703.tar.xz
swrap: Add libc_getpeername().
-rw-r--r--src/socket_wrapper.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index c054f36..05c934a 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -630,6 +630,15 @@ static int libc_dup2(int oldfd, int newfd)
return swrap.fns.libc_dup2(oldfd, newfd);
}
+static int libc_getpeername(int sockfd,
+ struct sockaddr *addr,
+ socklen_t *addrlen)
+{
+ swrap_load_lib_function(SWRAP_LIBSOCKET, getpeername);
+
+ return swrap.fns.libc_getpeername(sockfd, addr, addrlen);
+}
+
static int libc_vioctl(int d, unsigned long int request, va_list ap)
{
long int args[4];
@@ -2403,7 +2412,7 @@ static int swrap_getpeername(int s, struct sockaddr *name, socklen_t *addrlen)
struct socket_info *si = find_socket_info(s);
if (!si) {
- return swrap.fns.libc_getpeername(s, name, addrlen);
+ return libc_getpeername(s, name, addrlen);
}
if (!si->peername)