From 5b7e8960a325e7c3a9c08b24ce1079c0faa3c12d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 10 Dec 2013 07:57:26 +0100 Subject: swrap: Add libc_sendmsg(). --- src/socket_wrapper.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 0236a13..7d92f95 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -728,6 +728,13 @@ static int libc_send(int sockfd, const void *buf, size_t len, int flags) return swrap.fns.libc_send(sockfd, buf, len, flags); } +static int libc_sendmsg(int sockfd, const struct msghdr *msg, int flags) +{ + swrap_load_lib_function(SWRAP_LIBSOCKET, sendmsg); + + return swrap.fns.libc_sendmsg(sockfd, msg, flags); +} + /********************************************************* * SWRAP HELPER FUNCTIONS *********************************************************/ @@ -3141,7 +3148,7 @@ static ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags) int bcast = 0; if (!si) { - return swrap.fns.libc_sendmsg(s, omsg, flags); + return libc_sendmsg(s, omsg, flags); } tmp.iov_base = NULL; @@ -3206,7 +3213,7 @@ static ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags) msg.msg_namelen = sizeof(un_addr); /* size of address */ /* ignore the any errors in broadcast sends */ - swrap.fns.libc_sendmsg(s, &msg, flags); + libc_sendmsg(s, &msg, flags); } swrap_dump_packet(si, to, SWRAP_SENDTO, buf, len); @@ -3215,7 +3222,7 @@ static ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags) return len; } - ret = swrap.fns.libc_sendmsg(s, &msg, flags); + ret = libc_sendmsg(s, &msg, flags); swrap_sendmsg_after(si, &msg, to, ret); -- cgit