Skip to content

Commit

Permalink
tipc_sendmsg(): pass msghdr instead of its ->msg_iov
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 24, 2014
1 parent e0eb093 commit 562640f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,15 +700,15 @@ static unsigned int tipc_poll(struct file *file, struct socket *sock,
* tipc_sendmcast - send multicast message
* @sock: socket structure
* @seq: destination address
* @iov: message data to send
* @msg: message to send
* @dsz: total length of message data
* @timeo: timeout to wait for wakeup
*
* Called from function tipc_sendmsg(), which has done all sanity checks
* Returns the number of bytes sent on success, or errno
*/
static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,
struct iovec *iov, size_t dsz, long timeo)
struct msghdr *msg, size_t dsz, long timeo)
{
struct sock *sk = sock->sk;
struct tipc_msg *mhdr = &tipc_sk(sk)->phdr;
Expand All @@ -727,7 +727,7 @@ static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,

new_mtu:
mtu = tipc_bclink_get_mtu();
rc = tipc_msg_build(mhdr, iov, 0, dsz, mtu, &buf);
rc = tipc_msg_build(mhdr, msg->msg_iov, 0, dsz, mtu, &buf);
if (unlikely(rc < 0))
return rc;

Expand Down Expand Up @@ -951,7 +951,7 @@ static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock,
timeo = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);

if (dest->addrtype == TIPC_ADDR_MCAST) {
rc = tipc_sendmcast(sock, seq, iov, dsz, timeo);
rc = tipc_sendmcast(sock, seq, m, dsz, timeo);
goto exit;
} else if (dest->addrtype == TIPC_ADDR_NAME) {
u32 type = dest->addr.name.name.type;
Expand Down

0 comments on commit 562640f

Please sign in to comment.