aboutsummaryrefslogtreecommitdiff
path: root/net/netlabel/netlabel_cipso_v4.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 18:54:48 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 18:54:48 -0700
commitbf603625660b1742004bf86432ce3c210d14d4fd (patch)
treedb327975e92e01f2f2badb8ec5ae55282f156674 /net/netlabel/netlabel_cipso_v4.c
parentfbe96f92b3d9450e77a3a4bb1d46aa1bb908c1ab (diff)
parent6656e3c4c8e0c80f2d2bfece574876d269f64861 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [ATM]: [lec] use refcnt to protect lec_arp_entries outside lock [ATM]: [lec] add reference counting to lec_arp entries [ATM]: [lec] use work queue instead of timer for lec arp expiry [ATM]: [lec] old_close is no longer used [ATM]: [lec] convert lec_arp_table to hlist [ATM]: [lec] header indent, comment and whitespace cleanup [ATM]: [lec] indent, comment and whitespace cleanup [continued] [ATM]: [lec] indent, comment and whitespace cleanup [SCTP]: Do not timestamp every SCTP packet. [SCTP]: Use correct mask when disabling PMTUD. [SCTP]: Include sk_buff overhead while updating the peer's receive window. [SCTP]: Enable Nagle algorithm by default. [BNX2]: Disable MSI on 5706 if AMD 8132 bridge is present. [NetLabel]: audit fixups due to delayed feedback
Diffstat (limited to 'net/netlabel/netlabel_cipso_v4.c')
-rw-r--r--net/netlabel/netlabel_cipso_v4.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 09986ca962a..a6ce1d6d5c5 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -384,11 +384,15 @@ static int netlbl_cipsov4_add(struct sk_buff *skb, struct genl_info *info)
u32 doi;
const char *type_str = "(unknown)";
struct audit_buffer *audit_buf;
+ struct netlbl_audit audit_info;
if (!info->attrs[NLBL_CIPSOV4_A_DOI] ||
!info->attrs[NLBL_CIPSOV4_A_MTYPE])
return -EINVAL;
+ doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]);
+ netlbl_netlink_auditinfo(skb, &audit_info);
+
type = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_MTYPE]);
switch (type) {
case CIPSO_V4_MAP_STD:
@@ -401,13 +405,14 @@ static int netlbl_cipsov4_add(struct sk_buff *skb, struct genl_info *info)
break;
}
- if (ret_val == 0) {
- doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]);
- audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_ADD,
- NETLINK_CB(skb).sid);
- audit_log_format(audit_buf, " doi=%u type=%s", doi, type_str);
- audit_log_end(audit_buf);
- }
+ audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_ADD,
+ &audit_info);
+ audit_log_format(audit_buf,
+ " cipso_doi=%u cipso_type=%s res=%u",
+ doi,
+ type_str,
+ ret_val == 0 ? 1 : 0);
+ audit_log_end(audit_buf);
return ret_val;
}
@@ -668,20 +673,25 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info)
int ret_val = -EINVAL;
u32 doi = 0;
struct audit_buffer *audit_buf;
+ struct netlbl_audit audit_info;
- if (info->attrs[NLBL_CIPSOV4_A_DOI]) {
- doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]);
- ret_val = cipso_v4_doi_remove(doi,
- NETLINK_CB(skb).sid,
- netlbl_cipsov4_doi_free);
- }
+ if (!info->attrs[NLBL_CIPSOV4_A_DOI])
+ return -EINVAL;
- if (ret_val == 0) {
- audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_DEL,
- NETLINK_CB(skb).sid);
- audit_log_format(audit_buf, " doi=%u", doi);
- audit_log_end(audit_buf);
- }
+ doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]);
+ netlbl_netlink_auditinfo(skb, &audit_info);
+
+ ret_val = cipso_v4_doi_remove(doi,
+ &audit_info,
+ netlbl_cipsov4_doi_free);
+
+ audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_DEL,
+ &audit_info);
+ audit_log_format(audit_buf,
+ " cipso_doi=%u res=%u",
+ doi,
+ ret_val == 0 ? 1 : 0);
+ audit_log_end(audit_buf);
return ret_val;
}