FreeBSD/sys/security/mac/mac_net.c
/*
 * Retrieve the label associated with an mbuf by searching for the tag.
 * Depending on the value of mac_labelmbufs, it's possible that a label will
 * not be present, in which case NULL is returned.  Policies must handle the
 * possibility of an mbuf not having label storage if they do not enforce
 * early loading.
 */
Retrieve the label associated with an mbuf by searching for the tag.
Depending on the value of mac_labelmbufs, it's possible that a label will
not be present, in which case NULL is returned.  Policies must handle the
possibility of an mbuf not having label storage if they do not enforce
early loading.
Retrieve the label associated with an mbuf by searching for the tag . Depending on the value of mac_labelmbufs it ' s possible that a label will not be present in which case NULL is returned . Policies must handle the possibility of an mbuf not having label storage if they do not enforce early loading .
struct label *
mac_mbuf_to_label(struct mbuf *m)
{
	struct m_tag *tag;
	struct label *label;
	if (m == NULL)
		return (NULL);
	tag = m_tag_find(m, PACKET_TAG_MACLABEL, NULL);
	if (tag == NULL)
		return (NULL);
	label = (struct label *)(tag+1);
	return (label);
}
struct label * mac_mbuf_to_label ( struct mbuf * m ) { struct m_tag * tag ; struct label * label ; if ( m == NULL ) return ( NULL ) ; tag = m_tag_find ( m , PACKET_TAG_MACLABEL , NULL ) ; if ( tag == NULL ) return ( NULL ) ; label = ( struct label * ) ( tag + 1 ) ; return ( label ) ; }
Retrieve the label associated with an mbuf by searching for the tag.
Retrieve the label associated with an mbuf by searching for the tag .