summaryrefslogtreecommitdiffstats
path: root/sys/security/mac/mac_net.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-07-05 23:39:51 +0000
committerrwatson <rwatson@FreeBSD.org>2005-07-05 23:39:51 +0000
commit5e71112509f619704ade66a8c8429cb90bfff811 (patch)
tree003ec2c9d889fea416f06bf59091e4fb88ea39d8 /sys/security/mac/mac_net.c
parentefcac3d02eb12bd48b935fce603dac730c4f0f40 (diff)
downloadFreeBSD-src-5e71112509f619704ade66a8c8429cb90bfff811.zip
FreeBSD-src-5e71112509f619704ade66a8c8429cb90bfff811.tar.gz
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)
Diffstat (limited to 'sys/security/mac/mac_net.c')
-rw-r--r--sys/security/mac/mac_net.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/security/mac/mac_net.c b/sys/security/mac/mac_net.c
index d0afba9..8883e66 100644
--- a/sys/security/mac/mac_net.c
+++ b/sys/security/mac/mac_net.c
@@ -253,6 +253,17 @@ mac_copy_mbuf_tag(struct m_tag *src, struct m_tag *dest)
MAC_PERFORM(copy_mbuf_label, src_label, dest_label);
}
+void
+mac_copy_mbuf(struct mbuf *m_from, struct mbuf *m_to)
+{
+ struct label *src_label, *dest_label;
+
+ src_label = mac_mbuf_to_label(m_from);
+ dest_label = mac_mbuf_to_label(m_to);
+
+ MAC_PERFORM(copy_mbuf_label, src_label, dest_label);
+}
+
static void
mac_copy_ifnet_label(struct label *src, struct label *dest)
{
@@ -298,18 +309,6 @@ mac_create_bpfdesc(struct ucred *cred, struct bpf_d *bpf_d)
}
void
-mac_create_mbuf_from_mbuf(struct mbuf *oldmbuf, struct mbuf *newmbuf)
-{
- struct label *oldmbuflabel, *newmbuflabel;
-
- oldmbuflabel = mac_mbuf_to_label(oldmbuf);
- newmbuflabel = mac_mbuf_to_label(newmbuf);
-
- MAC_PERFORM(create_mbuf_from_mbuf, oldmbuf, oldmbuflabel, newmbuf,
- newmbuflabel);
-}
-
-void
mac_create_mbuf_from_bpfdesc(struct bpf_d *bpf_d, struct mbuf *mbuf)
{
struct label *label;
OpenPOWER on IntegriCloud