| 169 | } |
| 170 | |
| 171 | int |
| 172 | mac_mbuf_init(struct mbuf *m, int flag) |
| 173 | { |
| 174 | struct m_tag *tag; |
| 175 | int error; |
| 176 | |
| 177 | M_ASSERTPKTHDR(m); |
| 178 | |
| 179 | if (mac_labeled & MPC_OBJECT_MBUF) { |
| 180 | tag = m_tag_get(PACKET_TAG_MACLABEL, sizeof(struct label), |
| 181 | flag); |
| 182 | if (tag == NULL) |
| 183 | return (ENOMEM); |
| 184 | error = mac_mbuf_tag_init(tag, flag); |
| 185 | if (error) { |
| 186 | m_tag_free(tag); |
| 187 | return (error); |
| 188 | } |
| 189 | m_tag_prepend(m, tag); |
| 190 | } |
| 191 | return (0); |
| 192 | } |
| 193 | |
| 194 | static void |
| 195 | mac_bpfdesc_label_free(struct label *label) |
no test coverage detected