diff options
author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2012-06-20 15:22:08 +0200 |
---|---|---|
committer | Rob Kendrick (humdrum) <rob.kendrick@codethink.co.uk> | 2013-06-11 11:02:49 +0100 |
commit | c53f23c9ee9a4cd69e3bd52ef6b6348776756496 (patch) | |
tree | 28157d2555062a6e1c1967301fc5ca678d2fe978 | |
parent | acd175a6e84bca3136acdcd0953a2b69616cf49c (diff) | |
download | linux-c53f23c9ee9a4cd69e3bd52ef6b6348776756496.tar.gz |
scm: allow AF_BUS sockets to send ancillary data
UNIX domain sockets support passing file descriptors or process
credentials in the form of ancillary data.
Since AF_BUS sockets are used to communicate processes on a local
machine, they should also support passing control messages.
The core socket level control messages processing only allows sockets
whose family is PF_UNIX to send SCM_RIGHTS type messages. So, let's
also allow to PF_BUS sockets.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-rw-r--r-- | net/core/scm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index 611c5efd4cb0..87e31529945a 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -158,7 +158,8 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p) switch (cmsg->cmsg_type) { case SCM_RIGHTS: - if (!sock->ops || sock->ops->family != PF_UNIX) + if (!sock->ops || (sock->ops->family != PF_UNIX && + sock->ops->family != PF_BUS)) goto error; err=scm_fp_copy(cmsg, &p->fp); if (err<0) |