Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110746
b: refs/heads/master
c: cf9481e
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and James Morris committed Aug 5, 2008
1 parent ba7d385 commit 00691d1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 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: 0c0e186f812457e527c420f7a4d02865fd0dc7d2
refs/heads/master: cf9481e289247fe9cf40f2e2481220d899132049
42 changes: 24 additions & 18 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -3539,38 +3539,44 @@ static int selinux_parse_skb_ipv6(struct sk_buff *skb,
#endif /* IPV6 */

static int selinux_parse_skb(struct sk_buff *skb, struct avc_audit_data *ad,
char **addrp, int src, u8 *proto)
char **_addrp, int src, u8 *proto)
{
int ret = 0;
char *addrp;
int ret;

switch (ad->u.net.family) {
case PF_INET:
ret = selinux_parse_skb_ipv4(skb, ad, proto);
if (ret || !addrp)
break;
*addrp = (char *)(src ? &ad->u.net.v4info.saddr :
&ad->u.net.v4info.daddr);
break;
if (ret)
goto parse_error;
addrp = (char *)(src ? &ad->u.net.v4info.saddr :
&ad->u.net.v4info.daddr);
goto okay;

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case PF_INET6:
ret = selinux_parse_skb_ipv6(skb, ad, proto);
if (ret || !addrp)
break;
*addrp = (char *)(src ? &ad->u.net.v6info.saddr :
&ad->u.net.v6info.daddr);
break;
if (ret)
goto parse_error;
addrp = (char *)(src ? &ad->u.net.v6info.saddr :
&ad->u.net.v6info.daddr);
goto okay;
#endif /* IPV6 */
default:
break;
addrp = NULL;
goto okay;
}

if (unlikely(ret))
printk(KERN_WARNING
"SELinux: failure in selinux_parse_skb(),"
" unable to parse packet\n");

parse_error:
printk(KERN_WARNING
"SELinux: failure in selinux_parse_skb(),"
" unable to parse packet\n");
return ret;

okay:
if (_addrp)
*_addrp = addrp;
return 0;
}

/**
Expand Down

0 comments on commit 00691d1

Please sign in to comment.