diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-17 14:52:23 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-17 14:53:10 -0400 |
commit | 45bd00d31de886f8425b4dd33204b911b0a466a9 (patch) | |
tree | 06204f2452e02ca916666173d50f5035d69065ef /net/unix/af_unix.c | |
parent | 40d9d82c8ab8c4e2373a23a1e31dc8d84c53aa01 (diff) | |
parent | ab86e5765d41a5eb4239a1c04d613db87bea5ed8 (diff) |
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/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 5 |
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, | |||
1501 | struct sk_buff *skb; | 1501 | struct sk_buff *skb; |
1502 | int sent = 0; | 1502 | int sent = 0; |
1503 | struct scm_cookie tmp_scm; | 1503 | struct scm_cookie tmp_scm; |
1504 | bool fds_sent = false; | ||
1504 | 1505 | ||
1505 | if (NULL == siocb->scm) | 1506 | if (NULL == siocb->scm) |
1506 | siocb->scm = &tmp_scm; | 1507 | siocb->scm = &tmp_scm; |
@@ -1562,12 +1563,14 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1562 | size = min_t(int, size, skb_tailroom(skb)); | 1563 | size = min_t(int, size, skb_tailroom(skb)); |
1563 | 1564 | ||
1564 | memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred)); | 1565 | memcpy(UNIXCREDS(skb), &siocb->scm->creds, sizeof(struct ucred)); |
1565 | if (siocb->scm->fp) { | 1566 | /* Only send the fds in the first buffer */ |
1567 | if (siocb->scm->fp && !fds_sent) { | ||
1566 | err = unix_attach_fds(siocb->scm, skb); | 1568 | err = unix_attach_fds(siocb->scm, skb); |
1567 | if (err) { | 1569 | if (err) { |
1568 | kfree_skb(skb); | 1570 | kfree_skb(skb); |
1569 | goto out_err; | 1571 | goto out_err; |
1570 | } | 1572 | } |
1573 | fds_sent = true; | ||
1571 | } | 1574 | } |
1572 | 1575 | ||
1573 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 1576 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); |