diff options
Diffstat (limited to 'net/netlabel/netlabel_cipso_v4.c')
-rw-r--r-- | net/netlabel/netlabel_cipso_v4.c | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index a6ce1d6d5c59..743b05734a49 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -407,12 +407,14 @@ static int netlbl_cipsov4_add(struct sk_buff *skb, struct genl_info *info) | |||
407 | 407 | ||
408 | audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_ADD, | 408 | audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_ADD, |
409 | &audit_info); | 409 | &audit_info); |
410 | audit_log_format(audit_buf, | 410 | if (audit_buf != NULL) { |
411 | " cipso_doi=%u cipso_type=%s res=%u", | 411 | audit_log_format(audit_buf, |
412 | doi, | 412 | " cipso_doi=%u cipso_type=%s res=%u", |
413 | type_str, | 413 | doi, |
414 | ret_val == 0 ? 1 : 0); | 414 | type_str, |
415 | audit_log_end(audit_buf); | 415 | ret_val == 0 ? 1 : 0); |
416 | audit_log_end(audit_buf); | ||
417 | } | ||
416 | 418 | ||
417 | return ret_val; | 419 | return ret_val; |
418 | } | 420 | } |
@@ -452,17 +454,13 @@ static int netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info) | |||
452 | } | 454 | } |
453 | 455 | ||
454 | list_start: | 456 | list_start: |
455 | ans_skb = nlmsg_new(NLMSG_GOODSIZE * nlsze_mult, GFP_KERNEL); | 457 | ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE * nlsze_mult, GFP_KERNEL); |
456 | if (ans_skb == NULL) { | 458 | if (ans_skb == NULL) { |
457 | ret_val = -ENOMEM; | 459 | ret_val = -ENOMEM; |
458 | goto list_failure; | 460 | goto list_failure; |
459 | } | 461 | } |
460 | data = netlbl_netlink_hdr_put(ans_skb, | 462 | data = genlmsg_put_reply(ans_skb, info, &netlbl_cipsov4_gnl_family, |
461 | info->snd_pid, | 463 | 0, NLBL_CIPSOV4_C_LIST); |
462 | info->snd_seq, | ||
463 | netlbl_cipsov4_gnl_family.id, | ||
464 | 0, | ||
465 | NLBL_CIPSOV4_C_LIST); | ||
466 | if (data == NULL) { | 464 | if (data == NULL) { |
467 | ret_val = -ENOMEM; | 465 | ret_val = -ENOMEM; |
468 | goto list_failure; | 466 | goto list_failure; |
@@ -568,7 +566,7 @@ list_start: | |||
568 | 566 | ||
569 | genlmsg_end(ans_skb, data); | 567 | genlmsg_end(ans_skb, data); |
570 | 568 | ||
571 | ret_val = genlmsg_unicast(ans_skb, info->snd_pid); | 569 | ret_val = genlmsg_reply(ans_skb, info); |
572 | if (ret_val != 0) | 570 | if (ret_val != 0) |
573 | goto list_failure; | 571 | goto list_failure; |
574 | 572 | ||
@@ -607,12 +605,9 @@ static int netlbl_cipsov4_listall_cb(struct cipso_v4_doi *doi_def, void *arg) | |||
607 | struct netlbl_cipsov4_doiwalk_arg *cb_arg = arg; | 605 | struct netlbl_cipsov4_doiwalk_arg *cb_arg = arg; |
608 | void *data; | 606 | void *data; |
609 | 607 | ||
610 | data = netlbl_netlink_hdr_put(cb_arg->skb, | 608 | data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).pid, |
611 | NETLINK_CB(cb_arg->nl_cb->skb).pid, | 609 | cb_arg->seq, &netlbl_cipsov4_gnl_family, |
612 | cb_arg->seq, | 610 | NLM_F_MULTI, NLBL_CIPSOV4_C_LISTALL); |
613 | netlbl_cipsov4_gnl_family.id, | ||
614 | NLM_F_MULTI, | ||
615 | NLBL_CIPSOV4_C_LISTALL); | ||
616 | if (data == NULL) | 611 | if (data == NULL) |
617 | goto listall_cb_failure; | 612 | goto listall_cb_failure; |
618 | 613 | ||
@@ -687,11 +682,13 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info) | |||
687 | 682 | ||
688 | audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_DEL, | 683 | audit_buf = netlbl_audit_start_common(AUDIT_MAC_CIPSOV4_DEL, |
689 | &audit_info); | 684 | &audit_info); |
690 | audit_log_format(audit_buf, | 685 | if (audit_buf != NULL) { |
691 | " cipso_doi=%u res=%u", | 686 | audit_log_format(audit_buf, |
692 | doi, | 687 | " cipso_doi=%u res=%u", |
693 | ret_val == 0 ? 1 : 0); | 688 | doi, |
694 | audit_log_end(audit_buf); | 689 | ret_val == 0 ? 1 : 0); |
690 | audit_log_end(audit_buf); | ||
691 | } | ||
695 | 692 | ||
696 | return ret_val; | 693 | return ret_val; |
697 | } | 694 | } |