Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80892
b: refs/heads/master
c: 8cc4457
h: refs/heads/master
v: v3
  • Loading branch information
Paul Moore authored and James Morris committed Jan 29, 2008
1 parent 644d226 commit 7adeef7
Show file tree
Hide file tree
Showing 5 changed files with 1,525 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: 5dbe1eb0cfc144a2b0cb1466e22bcb6fc34229a8
refs/heads/master: 8cc44579d1bd77ba3a32f2cb76fd9669c229c5fd
6 changes: 5 additions & 1 deletion trunk/include/net/netlabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@
* NetLabel NETLINK protocol
*/

#define NETLBL_PROTO_VERSION 1
/* NetLabel NETLINK protocol version
* 1: initial version
* 2: added static labels for unlabeled connections
*/
#define NETLBL_PROTO_VERSION 2

/* NetLabel NETLINK types/families */
#define NETLBL_NLTYPE_NONE 0
Expand Down
16 changes: 7 additions & 9 deletions trunk/net/netlabel/netlabel_kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,21 +312,15 @@ int netlbl_sock_setattr(struct sock *sk,
* @secattr: the security attributes
*
* Description:
* Examines the given sock to see any NetLabel style labeling has been
* Examines the given sock to see if any NetLabel style labeling has been
* applied to the sock, if so it parses the socket label and returns the
* security attributes in @secattr. Returns zero on success, negative values
* on failure.
*
*/
int netlbl_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr)
{
int ret_val;

ret_val = cipso_v4_sock_getattr(sk, secattr);
if (ret_val == 0)
return 0;

return netlbl_unlabel_getattr(secattr);
return cipso_v4_sock_getattr(sk, secattr);
}

/**
Expand All @@ -350,7 +344,7 @@ int netlbl_skbuff_getattr(const struct sk_buff *skb,
cipso_v4_skbuff_getattr(skb, secattr) == 0)
return 0;

return netlbl_unlabel_getattr(secattr);
return netlbl_unlabel_getattr(skb, family, secattr);
}

/**
Expand Down Expand Up @@ -434,6 +428,10 @@ static int __init netlbl_init(void)
if (ret_val != 0)
goto init_failure;

ret_val = netlbl_unlabel_init(NETLBL_UNLHSH_BITSIZE);
if (ret_val != 0)
goto init_failure;

ret_val = netlbl_netlink_init();
if (ret_val != 0)
goto init_failure;
Expand Down
Loading

0 comments on commit 7adeef7

Please sign in to comment.