From 625dc6b51aaf5929beb1e69b13463b77081d7355 Mon Sep 17 00:00:00 2001 From: rwatson Date: Fri, 18 Apr 2003 20:22:23 +0000 Subject: 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 --- sys/security/mac_ifoff/mac_ifoff.c | 7 +++---- 1 file 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); } -- cgit v1.1