From e5680de54abac941f9b0f099aec14f24e493feb4 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 26 Mar 2003 15:12:03 +0000 Subject: Modify the mac_init_ipq() MAC Framework entry point to accept an additional flags argument to indicate blocking disposition, and pass in M_NOWAIT from the IP reassembly code to indicate that blocking is not OK when labeling a new IP fragment reassembly queue. This should eliminate some of the WITNESS warnings that have started popping up since fine-grained IP stack locking started going in; if memory allocation fails, the creation of the fragment queue will be aborted. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories --- sys/security/mac/mac_pipe.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sys/security/mac/mac_pipe.c') diff --git a/sys/security/mac/mac_pipe.c b/sys/security/mac/mac_pipe.c index 6b2e653..17b37d8 100644 --- a/sys/security/mac/mac_pipe.c +++ b/sys/security/mac/mac_pipe.c @@ -697,15 +697,23 @@ mac_init_ifnet(struct ifnet *ifp) mac_init_ifnet_label(&ifp->if_label); } -void -mac_init_ipq(struct ipq *ipq) +int +mac_init_ipq(struct ipq *ipq, int flag) { + int error; mac_init_label(&ipq->ipq_label); - MAC_PERFORM(init_ipq_label, &ipq->ipq_label); + + MAC_CHECK(init_ipq_label, &ipq->ipq_label, flag); + if (error) { + MAC_PERFORM(destroy_ipq_label, &ipq->ipq_label); + mac_destroy_label(&ipq->ipq_label); + } #ifdef MAC_DEBUG - atomic_add_int(&nmacipqs, 1); + if (error == 0) + atomic_add_int(&nmacipqs, 1); #endif + return (error); } int -- cgit v1.1