diff options
author | des <des@FreeBSD.org> | 2003-04-08 14:25:47 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-04-08 14:25:47 +0000 |
commit | 567ac2b268739a751df819d1aa68404f430151cb (patch) | |
tree | a9d6dfe9fba9afa35e60736c6acc2bb7970ecd0a /sys/security/mac | |
parent | e105056ea61ca6ae4a0e93115e8916181e93be8b (diff) | |
download | FreeBSD-src-567ac2b268739a751df819d1aa68404f430151cb.zip FreeBSD-src-567ac2b268739a751df819d1aa68404f430151cb.tar.gz |
Introduce an M_ASSERTPKTHDR() macro which performs the very common task
of asserting that an mbuf has a packet header. Use it instead of hand-
rolled versions wherever applicable.
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
Diffstat (limited to 'sys/security/mac')
-rw-r--r-- | sys/security/mac/mac_framework.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_internal.h | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_net.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_pipe.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_process.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_syscalls.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_system.c | 4 | ||||
-rw-r--r-- | sys/security/mac/mac_vfs.c | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_internal.h +++ b/sys/security/mac/mac_internal.h @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_net.c b/sys/security/mac/mac_net.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_net.c +++ b/sys/security/mac/mac_net.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_pipe.c b/sys/security/mac/mac_pipe.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_pipe.c +++ b/sys/security/mac/mac_pipe.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_process.c +++ b/sys/security/mac/mac_process.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_system.c b/sys/security/mac/mac_system.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_system.c +++ b/sys/security/mac/mac_system.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c index 17b37d8..38f7e9b 100644 --- a/sys/security/mac/mac_vfs.c +++ b/sys/security/mac/mac_vfs.c @@ -721,7 +721,7 @@ mac_init_mbuf(struct mbuf *m, int flag) { int error; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + M_ASSERTPKTHDR(m); mac_init_label(&m->m_pkthdr.label); @@ -2270,7 +2270,7 @@ mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + M_ASSERTPKTHDR(mbuf); if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) if_printf(ifnet, "not initialized\n"); |