From 5e71112509f619704ade66a8c8429cb90bfff811 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 5 Jul 2005 23:39:51 +0000 Subject: Eliminate MAC entry point mac_create_mbuf_from_mbuf(), which is redundant with respect to existing mbuf copy label routines. Expose a new mac_copy_mbuf() routine at the top end of the Framework and use that; use the existing mpo_copy_mbuf_label() routine on the bottom end. Obtained from: TrustedBSD Project Sponsored by: SPARTA, SPAWAR Approved by: re (scottl) --- sys/security/mac_lomac/mac_lomac.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'sys/security/mac_lomac/mac_lomac.c') diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index c4c001a..1a090ec 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -1355,27 +1355,6 @@ mac_lomac_create_mbuf_from_inpcb(struct inpcb *inp, struct label *inplabel, } static void -mac_lomac_create_mbuf_from_mbuf(struct mbuf *oldmbuf, - struct label *oldmbuflabel, struct mbuf *newmbuf, - struct label *newmbuflabel) -{ - struct mac_lomac *source, *dest; - - source = SLOT(oldmbuflabel); - dest = SLOT(newmbuflabel); - - /* - * Because the source mbuf may not yet have been "created", - * just initialized, we do a conditional copy. Since we don't - * allow mbufs to have ranges, do a KASSERT to make sure that - * doesn't happen. - */ - KASSERT((source->ml_flags & MAC_LOMAC_FLAG_RANGE) == 0, - ("mac_lomac_create_mbuf_from_mbuf: source mbuf has range")); - mac_lomac_copy(source, dest); -} - -static void mac_lomac_create_mbuf_linklayer(struct ifnet *ifnet, struct label *ifnetlabel, struct mbuf *mbuf, struct label *mbuflabel) { @@ -2663,7 +2642,6 @@ static struct mac_policy_ops mac_lomac_ops = .mpo_create_inpcb_from_socket = mac_lomac_create_inpcb_from_socket, .mpo_create_ipq = mac_lomac_create_ipq, .mpo_create_mbuf_from_inpcb = mac_lomac_create_mbuf_from_inpcb, - .mpo_create_mbuf_from_mbuf = mac_lomac_create_mbuf_from_mbuf, .mpo_create_mbuf_linklayer = mac_lomac_create_mbuf_linklayer, .mpo_create_mbuf_from_bpfdesc = mac_lomac_create_mbuf_from_bpfdesc, .mpo_create_mbuf_from_ifnet = mac_lomac_create_mbuf_from_ifnet, -- cgit v1.1