mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
s3:messaging: protect use of msg_control with HAVE_STRUCT_MSGHDR_MSG_CONTROL
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Jun 3 01:14:17 CEST 2014 on sn-devel-104
This commit is contained in:
parent
65a6c31d9d
commit
6a0ebc4596
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user