diff options
author | Andreas Schneider <asn@samba.org> | 2014-06-03 14:57:08 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-06-05 23:57:10 +0200 |
commit | fb308daaa038d966cf0385313a9b58ab24164773 (patch) | |
tree | 4e3988a66408bf69281e44aae55328595c40e2e1 | |
parent | b534c45a2a0689d4ff781772ebf75d2fa3d2a110 (diff) | |
download | samba-fb308daaa038d966cf0385313a9b58ab24164773.tar.gz samba-fb308daaa038d966cf0385313a9b58ab24164773.tar.xz samba-fb308daaa038d966cf0385313a9b58ab24164773.zip |
swrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | lib/socket_wrapper/socket_wrapper.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c index fdb0c5984c5..e77ef85e7c9 100644 --- a/lib/socket_wrapper/socket_wrapper.c +++ b/lib/socket_wrapper/socket_wrapper.c @@ -3400,6 +3400,7 @@ static int swrap_recvmsg_after(int fd, off_t ofs = 0; size_t avail = 0; size_t remain; + int rc; /* to give better errors */ if (ret == -1) { @@ -3416,8 +3417,8 @@ static int swrap_recvmsg_after(int fd, } if (avail == 0) { - errno = saved_errno; - return 0; + rc = 0; + goto done; } if (ret == -1) { @@ -3460,8 +3461,6 @@ static int swrap_recvmsg_after(int fd, } if (un_addr != NULL) { - int rc; - rc = sockaddr_convert_from_un(si, un_addr, un_addrlen, @@ -3488,10 +3487,23 @@ static int swrap_recvmsg_after(int fd, break; } + rc = 0; done: free(buf); errno = saved_errno; - return 0; + +#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL + if (rc == 0 && + msg->msg_controllen > 0 && + msg->msg_control != NULL) { + rc = swrap_msghdr_add_socket_info(si, msg); + if (rc < 0) { + return -1; + } + } +#endif + + return rc; } /**************************************************************************** |