summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-06-03 15:03:03 +0200
committerMichael Adam <obnox@samba.org>2014-06-05 23:57:10 +0200
commitc704966f7980a9de333045fec8f5418abda57a5b (patch)
tree36fa5aed0c707712b5f100302241317648fcb7c1 /lib
parent0247bdbbc8a3b0ee5d0186a6a9f0d58e03469618 (diff)
downloadsamba-c704966f7980a9de333045fec8f5418abda57a5b.tar.gz
samba-c704966f7980a9de333045fec8f5418abda57a5b.tar.xz
samba-c704966f7980a9de333045fec8f5418abda57a5b.zip
swrap: Add swrap_sendmsg_filter_cmsghdr().
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 7a0b63ca61..26750b0c08 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -3144,6 +3144,33 @@ static int swrap_msghdr_add_socket_info(struct socket_info *si,
return rc;
}
+
+static int swrap_sendmsg_filter_cmsghdr(struct msghdr *msg,
+ uint8_t *cm_data,
+ size_t *cm_data_space) {
+ struct cmsghdr *cmsg;
+ int rc = -1;
+
+ /* Nothing to do */
+ if (msg->msg_controllen == 0 || msg->msg_control == NULL) {
+ return 0;
+ }
+
+ for (cmsg = CMSG_FIRSTHDR(msg);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ switch (cmsg->cmsg_level) {
+ case IPPROTO_IP:
+ /* TODO swrap_sendmsg_filter_cmsg_socket */
+ break;
+ default:
+ /* TODO swrap_sendmsg_copy_cmsg */
+ break;
+ }
+ }
+
+ return rc;
+}
#endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
static ssize_t swrap_sendmsg_before(int fd,