summaryrefslogtreecommitdiff
path: root/net/unix
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-09-17 20:52:23 +0200
committerIngo Molnar <mingo@elte.hu>2009-09-17 20:53:10 +0200
commit45bd00d31de886f8425b4dd33204b911b0a466a9 (patch)
tree06204f2452e02ca916666173d50f5035d69065ef /net/unix
parent40d9d82c8ab8c4e2373a23a1e31dc8d84c53aa01 (diff)
parentab86e5765d41a5eb4239a1c04d613db87bea5ed8 (diff)
downloadlinux-next-45bd00d31de886f8425b4dd33204b911b0a466a9.tar.gz
Merge branch 'linus' into tracing/core
Merge reason: Pick up kernel/softirq.c update for dependent fix. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index fc3ebb906911..51ab497115eb 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1501,6 +1501,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct sk_buff *skb;
int sent = 0;
struct scm_cookie tmp_scm;
+ bool fds_sent = false;
if (NULL == siocb->scm)
siocb->scm = &tmp_scm;
@@ -1562,12 +1563,14 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
size = min_t(int, size, skb_tailroom(skb));
memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
- if (siocb->scm->fp) {
+ /* Only send the fds in the first buffer */
+ if (siocb->scm->fp && !fds_sent) {
err = unix_attach_fds(siocb->scm, skb);
if (err) {
kfree_skb(skb);
goto out_err;
}
+ fds_sent = true;
}
err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);