summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-10 08:12:16 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-10 08:12:16 +0100
commit4b72d3005246fb31ec038fc908729672df47364d (patch)
tree89cd216422bf7e93af4c772373d4a9b04e14c0bd
parenta6bbc3867e96fb30a53ffacda28ee4e8344f8542 (diff)
downloadsocket_wrapper-4b72d3005246fb31ec038fc908729672df47364d.zip
socket_wrapper-4b72d3005246fb31ec038fc908729672df47364d.tar.gz
socket_wrapper-4b72d3005246fb31ec038fc908729672df47364d.tar.xz
swrap: Add libc_setsockopt().
-rw-r--r--src/socket_wrapper.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 2a23d19..9f9b8b4 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -747,6 +747,17 @@ static int libc_sendto(int sockfd,
return swrap.fns.libc_sendto(sockfd, buf, len, flags, dst_addr, addrlen);
}
+static int libc_setsockopt(int sockfd,
+ int level,
+ int optname,
+ const void *optval,
+ socklen_t optlen)
+{
+ swrap_load_lib_function(SWRAP_LIBSOCKET, setsockopt);
+
+ return swrap.fns.libc_setsockopt(sockfd, level, optname, optval, optlen);
+}
+
/*********************************************************
* SWRAP HELPER FUNCTIONS
*********************************************************/
@@ -2599,19 +2610,19 @@ static int swrap_setsockopt(int s, int level, int optname,
struct socket_info *si = find_socket_info(s);
if (!si) {
- return swrap.fns.libc_setsockopt(s,
- level,
- optname,
- optval,
- optlen);
+ return libc_setsockopt(s,
+ level,
+ optname,
+ optval,
+ optlen);
}
if (level == SOL_SOCKET) {
- return swrap.fns.libc_setsockopt(s,
- level,
- optname,
- optval,
- optlen);
+ return libc_setsockopt(s,
+ level,
+ optname,
+ optval,
+ optlen);
}
switch (si->family) {