| 61 | #include <security/mac/mac_policy.h> |
| 62 | |
| 63 | static struct label * |
| 64 | mac_ip6q_label_alloc(int flag) |
| 65 | { |
| 66 | struct label *label; |
| 67 | int error; |
| 68 | |
| 69 | label = mac_labelzone_alloc(flag); |
| 70 | if (label == NULL) |
| 71 | return (NULL); |
| 72 | |
| 73 | if (flag & M_WAITOK) |
| 74 | MAC_POLICY_CHECK(ip6q_init_label, label, flag); |
| 75 | else |
| 76 | MAC_POLICY_CHECK_NOSLEEP(ip6q_init_label, label, flag); |
| 77 | if (error) { |
| 78 | MAC_POLICY_PERFORM_NOSLEEP(ip6q_destroy_label, label); |
| 79 | mac_labelzone_free(label); |
| 80 | return (NULL); |
| 81 | } |
| 82 | return (label); |
| 83 | } |
| 84 | |
| 85 | int |
| 86 | mac_ip6q_init(struct ip6q *q6, int flag) |
no test coverage detected