diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-15 01:16:27 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 05:16:41 -0500 |
commit | 45dcc687f764f89e1e7c41dace52b105494e5dbb (patch) | |
tree | 569dd194d3e7107c930da7762330b32f6efdd013 /net/tipc/msg.c | |
parent | 562640f3c3fb64fca24253868dab6e900e305c46 (diff) |
tipc_msg_build(): pass msghdr instead of its ->msg_iov
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/tipc/msg.c')
-rw-r--r-- | net/tipc/msg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/tipc/msg.c b/net/tipc/msg.c index ec18076e81ec..9155496b8a8a 100644 --- a/net/tipc/msg.c +++ b/net/tipc/msg.c | |||
@@ -162,14 +162,14 @@ err: | |||
162 | /** | 162 | /** |
163 | * tipc_msg_build - create buffer chain containing specified header and data | 163 | * tipc_msg_build - create buffer chain containing specified header and data |
164 | * @mhdr: Message header, to be prepended to data | 164 | * @mhdr: Message header, to be prepended to data |
165 | * @iov: User data | 165 | * @m: User message |
166 | * @offset: Posision in iov to start copying from | 166 | * @offset: Posision in iov to start copying from |
167 | * @dsz: Total length of user data | 167 | * @dsz: Total length of user data |
168 | * @pktmax: Max packet size that can be used | 168 | * @pktmax: Max packet size that can be used |
169 | * @chain: Buffer or chain of buffers to be returned to caller | 169 | * @chain: Buffer or chain of buffers to be returned to caller |
170 | * Returns message data size or errno: -ENOMEM, -EFAULT | 170 | * Returns message data size or errno: -ENOMEM, -EFAULT |
171 | */ | 171 | */ |
172 | int tipc_msg_build(struct tipc_msg *mhdr, struct iovec const *iov, | 172 | int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m, |
173 | int offset, int dsz, int pktmax , struct sk_buff **chain) | 173 | int offset, int dsz, int pktmax , struct sk_buff **chain) |
174 | { | 174 | { |
175 | int mhsz = msg_hdr_sz(mhdr); | 175 | int mhsz = msg_hdr_sz(mhdr); |
@@ -194,7 +194,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct iovec const *iov, | |||
194 | skb_copy_to_linear_data(buf, mhdr, mhsz); | 194 | skb_copy_to_linear_data(buf, mhdr, mhsz); |
195 | pktpos = buf->data + mhsz; | 195 | pktpos = buf->data + mhsz; |
196 | TIPC_SKB_CB(buf)->chain_sz = 1; | 196 | TIPC_SKB_CB(buf)->chain_sz = 1; |
197 | if (!dsz || !memcpy_fromiovecend(pktpos, iov, offset, dsz)) | 197 | if (!dsz || !memcpy_fromiovecend(pktpos, m->msg_iov, offset, dsz)) |
198 | return dsz; | 198 | return dsz; |
199 | rc = -EFAULT; | 199 | rc = -EFAULT; |
200 | goto error; | 200 | goto error; |
@@ -223,7 +223,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct iovec const *iov, | |||
223 | if (drem < pktrem) | 223 | if (drem < pktrem) |
224 | pktrem = drem; | 224 | pktrem = drem; |
225 | 225 | ||
226 | if (memcpy_fromiovecend(pktpos, iov, offset, pktrem)) { | 226 | if (memcpy_fromiovecend(pktpos, m->msg_iov, offset, pktrem)) { |
227 | rc = -EFAULT; | 227 | rc = -EFAULT; |
228 | goto error; | 228 | goto error; |
229 | } | 229 | } |