From 6a0ebc45968e65fa65cb23582d109531733e8a0e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 31 May 2014 12:16:08 +0200 Subject: s3:messaging: protect use of msg_control with HAVE_STRUCT_MSGHDR_MSG_CONTROL Signed-off-by: Michael Adam Reviewed-by: Andreas Schneider Autobuild-User(master): Michael Adam Autobuild-Date(master): Tue Jun 3 01:14:17 CEST 2014 on sn-devel-104 --- source3/lib/unix_msg/unix_msg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/lib/unix_msg/unix_msg.c b/source3/lib/unix_msg/unix_msg.c index bcabd28da28..602ecc63f6f 100644 --- a/source3/lib/unix_msg/unix_msg.c +++ b/source3/lib/unix_msg/unix_msg.c @@ -244,8 +244,10 @@ static void unix_dgram_recv_handler(struct poll_watch *w, int fd, short events, msg = (struct msghdr) { .msg_iov = &iov, .msg_iovlen = 1, +#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL .msg_control = NULL, .msg_controllen = 0, +#endif }; received = recvmsg(fd, &msg, 0); @@ -509,8 +511,10 @@ static int unix_dgram_send(struct unix_dgram_ctx *ctx, const char *dst_sock, msg.msg_namelen = sizeof(addr); msg.msg_iov = discard_const_p(struct iovec, iov); msg.msg_iovlen = iovlen; +#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL msg.msg_control = NULL; msg.msg_controllen = 0; +#endif msg.msg_flags = 0; ret = sendmsg(ctx->sock, &msg, 0); -- cgit