summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-04-18 20:22:23 +0000
committerrwatson <rwatson@FreeBSD.org>2003-04-18 20:22:23 +0000
commit625dc6b51aaf5929beb1e69b13463b77081d7355 (patch)
treeb0ae495bda73100c0e40be059756a246916cf8e1
parent8b7a3b47d15df24c762596b1df532e54646f0af9 (diff)
downloadFreeBSD-src-625dc6b51aaf5929beb1e69b13463b77081d7355.zip
FreeBSD-src-625dc6b51aaf5929beb1e69b13463b77081d7355.tar.gz
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
-rw-r--r--sys/security/mac_ifoff/mac_ifoff.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/security/mac_ifoff/mac_ifoff.c b/sys/security/mac_ifoff/mac_ifoff.c
index 941d48e..286e8dd 100644
--- a/sys/security/mac_ifoff/mac_ifoff.c
+++ b/sys/security/mac_ifoff/mac_ifoff.c
@@ -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);
}
OpenPOWER on IntegriCloud