Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202976
b: refs/heads/master
c: b47030c
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Jun 16, 2010
1 parent 24c292a commit e20342f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 109f6e39fa07c48f580125f531f46cb7c245b528
refs/heads/master: b47030c71dfd6c8cd5cb6e551b6f7f7cfc96f6a6
11 changes: 8 additions & 3 deletions trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,19 +1323,23 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
if (msg->msg_flags&MSG_OOB)
return -EOPNOTSUPP;

if (NULL == siocb->scm)
if (NULL == siocb->scm) {
siocb->scm = &scm;
memset(&scm, 0, sizeof(scm));
}
err = scm_send(sock, msg, siocb->scm);
if (err < 0)
return err;

if (msg->msg_namelen) {
err = -EINVAL;
if (addr->nl_family != AF_NETLINK)
return -EINVAL;
goto out;
dst_pid = addr->nl_pid;
dst_group = ffs(addr->nl_groups);
err = -EPERM;
if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND))
return -EPERM;
goto out;
} else {
dst_pid = nlk->dst_pid;
dst_group = nlk->dst_group;
Expand Down Expand Up @@ -1387,6 +1391,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT);

out:
scm_destroy(siocb->scm);
return err;
}

Expand Down

0 comments on commit e20342f

Please sign in to comment.