Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91705
b: refs/heads/master
c: c544c02
h: refs/heads/master
i:
  91703: d693e0d
v: v3
  • Loading branch information
Eric Paris authored and James Morris committed Apr 21, 2008
1 parent c9c6df7 commit 0b0f23a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: a6aaafeecca7ea1ddb5d7dac09e468ae14751fcd
refs/heads/master: c544c028e45feceeb48b629456d0eb43adc8eaaf
20 changes: 10 additions & 10 deletions trunk/security/selinux/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ static struct sock *selnl;
static int selnl_msglen(int msgtype)
{
int ret = 0;

switch (msgtype) {
case SELNL_MSG_SETENFORCE:
ret = sizeof(struct selnl_msg_setenforce);
break;

case SELNL_MSG_POLICYLOAD:
ret = sizeof(struct selnl_msg_policyload);
break;

default:
BUG();
}
Expand All @@ -45,15 +45,15 @@ static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *
switch (msgtype) {
case SELNL_MSG_SETENFORCE: {
struct selnl_msg_setenforce *msg = NLMSG_DATA(nlh);

memset(msg, 0, len);
msg->val = *((int *)data);
break;
}

case SELNL_MSG_POLICYLOAD: {
struct selnl_msg_policyload *msg = NLMSG_DATA(nlh);

memset(msg, 0, len);
msg->seqno = *((u32 *)data);
break;
Expand All @@ -70,9 +70,9 @@ static void selnl_notify(int msgtype, void *data)
sk_buff_data_t tmp;
struct sk_buff *skb;
struct nlmsghdr *nlh;

len = selnl_msglen(msgtype);

skb = alloc_skb(NLMSG_SPACE(len), GFP_USER);
if (!skb)
goto oom;
Expand All @@ -85,7 +85,7 @@ static void selnl_notify(int msgtype, void *data)
netlink_broadcast(selnl, skb, 0, SELNLGRP_AVC, GFP_USER);
out:
return;

nlmsg_failure:
kfree_skb(skb);
oom:
Expand All @@ -109,7 +109,7 @@ static int __init selnl_init(void)
SELNLGRP_MAX, NULL, NULL, THIS_MODULE);
if (selnl == NULL)
panic("SELinux: Cannot create netlink socket.");
netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV);
netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV);
return 0;
}

Expand Down

0 comments on commit 0b0f23a

Please sign in to comment.