Rather than check for M_PKTHDR and conditionally perform access control,

simply assert that M_PKTHDR is set using M_ASSERTPKTHDR().

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
This commit is contained in:
Robert Watson 2003-04-18 20:22:23 +00:00
parent 889a6b5845
commit 535cf73341
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113687

View File

@ -147,10 +147,9 @@ mac_ifoff_check_socket_deliver(struct socket *so, struct label *socketlabel,
struct mbuf *m, struct label *mbuflabel)
{
if (m->m_flags & M_PKTHDR) {
if (m->m_pkthdr.rcvif != NULL)
return (check_ifnet_incoming(m->m_pkthdr.rcvif, 0));
}
M_ASSERTPKTHDR(m);
if (m->m_pkthdr.rcvif != NULL)
return (check_ifnet_incoming(m->m_pkthdr.rcvif, 0));
return (0);
}