From 2a9e17ce8e0e9ac0c0e105a3495b919a9182694b Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 28 Oct 2007 17:55:57 +0000 Subject: Garbage collect mac_mbuf_create_multicast_encap TrustedBSD MAC Framework entry point, which is no longer required now that we don't support old-style multicast tunnels. This removes the last mbuf object class entry point that isn't init/copy/destroy. Obtained from: TrustedBSD Project --- sys/security/mac/mac_framework.h | 2 -- sys/security/mac/mac_net.c | 15 --------------- sys/security/mac/mac_policy.h | 5 ----- sys/security/mac_biba/mac_biba.c | 14 -------------- sys/security/mac_lomac/mac_lomac.c | 14 -------------- sys/security/mac_mls/mac_mls.c | 14 -------------- sys/security/mac_stub/mac_stub.c | 9 --------- sys/security/mac_test/mac_test.c | 14 -------------- 8 files changed, 87 deletions(-) (limited to 'sys/security') diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h index 3ea349097867..f3d41df975bb 100644 --- a/sys/security/mac/mac_framework.h +++ b/sys/security/mac/mac_framework.h @@ -152,8 +152,6 @@ int mac_kld_check_load(struct ucred *cred, struct vnode *vp); int mac_kld_check_stat(struct ucred *cred); void mac_mbuf_copy(struct mbuf *, struct mbuf *); -void mac_mbuf_create_multicast_encap(struct mbuf *m, struct ifnet *ifp, - struct mbuf *mnew); int mac_mbuf_init(struct mbuf *, int); void mac_mbuf_tag_copy(struct m_tag *, struct m_tag *); diff --git a/sys/security/mac/mac_net.c b/sys/security/mac/mac_net.c index c451a293d547..0b4ec4ed0121 100644 --- a/sys/security/mac/mac_net.c +++ b/sys/security/mac/mac_net.c @@ -319,21 +319,6 @@ mac_ifnet_create_mbuf(struct ifnet *ifp, struct mbuf *m) MAC_IFNET_UNLOCK(ifp); } -void -mac_mbuf_create_multicast_encap(struct mbuf *m, struct ifnet *ifp, - struct mbuf *mnew) -{ - struct label *mlabel, *mnewlabel; - - mlabel = mac_mbuf_to_label(m); - mnewlabel = mac_mbuf_to_label(mnew); - - MAC_IFNET_LOCK(ifp); - MAC_PERFORM(mbuf_create_multicast_encap, m, mlabel, ifp, - ifp->if_label, mnew, mnewlabel); - MAC_IFNET_UNLOCK(ifp); -} - int mac_bpfdesc_check_receive(struct bpf_d *d, struct ifnet *ifp) { diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h index 8f26818ede0a..3d494db7bee8 100644 --- a/sys/security/mac/mac_policy.h +++ b/sys/security/mac/mac_policy.h @@ -221,10 +221,6 @@ typedef int (*mpo_kld_check_stat_t)(struct ucred *cred); typedef void (*mpo_mbuf_copy_label_t)(struct label *src, struct label *dest); -typedef void (*mpo_mbuf_create_multicast_encap_t)(struct mbuf *m, - struct label *mlabel, struct ifnet *ifp, - struct label *ifplabel, struct mbuf *mnew, - struct label *mnewlabel); typedef void (*mpo_mbuf_destroy_label_t)(struct label *label); typedef int (*mpo_mbuf_init_label_t)(struct label *label, int flag); @@ -692,7 +688,6 @@ struct mac_policy_ops { mpo_kld_check_stat_t mpo_kld_check_stat; mpo_mbuf_copy_label_t mpo_mbuf_copy_label; - mpo_mbuf_create_multicast_encap_t mpo_mbuf_create_multicast_encap; mpo_mbuf_destroy_label_t mpo_mbuf_destroy_label; mpo_mbuf_init_label_t mpo_mbuf_init_label; diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index 5702c01fd66f..72f974519c7f 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -1291,19 +1291,6 @@ biba_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel, biba_copy_effective(source, dest); } -static void -biba_mbuf_create_multicast_encap(struct mbuf *m, struct label *mlabel, - struct ifnet *ifp, struct label *ifplabel, struct mbuf *mnew, - struct label *mnewlabel) -{ - struct mac_biba *source, *dest; - - source = SLOT(mlabel); - dest = SLOT(mnewlabel); - - biba_copy_effective(source, dest); -} - static int biba_ipq_match(struct mbuf *m, struct label *mlabel, struct ipq *ipq, struct label *ipqlabel) @@ -3367,7 +3354,6 @@ static struct mac_policy_ops mac_biba_ops = .mpo_inpcb_create_mbuf = biba_inpcb_create_mbuf, .mpo_bpfdesc_create_mbuf = biba_bpfdesc_create_mbuf, .mpo_ifnet_create_mbuf = biba_ifnet_create_mbuf, - .mpo_mbuf_create_multicast_encap = biba_mbuf_create_multicast_encap, .mpo_ipq_match = biba_ipq_match, .mpo_ifnet_relabel = biba_ifnet_relabel, .mpo_ipq_update = biba_ipq_update, diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index 796badcecc76..6ee206a7ac43 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -1355,19 +1355,6 @@ lomac_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel, lomac_copy_single(source, dest); } -static void -lomac_mbuf_create_multicast_encap(struct mbuf *m, struct label *mlabel, - struct ifnet *ifp, struct label *ifplabel, struct mbuf *mnew, - struct label *mnewlabel) -{ - struct mac_lomac *source, *dest; - - source = SLOT(mlabel); - dest = SLOT(mnewlabel); - - lomac_copy_single(source, dest); -} - static int lomac_ipq_match(struct mbuf *m, struct label *mlabel, struct ipq *ipq, struct label *ipqlabel) @@ -2925,7 +2912,6 @@ static struct mac_policy_ops lomac_ops = .mpo_inpcb_create_mbuf = lomac_inpcb_create_mbuf, .mpo_bpfdesc_create_mbuf = lomac_bpfdesc_create_mbuf, .mpo_ifnet_create_mbuf = lomac_ifnet_create_mbuf, - .mpo_mbuf_create_multicast_encap = lomac_mbuf_create_multicast_encap, .mpo_ipq_match = lomac_ipq_match, .mpo_ifnet_relabel = lomac_ifnet_relabel, .mpo_ipq_update = lomac_ipq_update, diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c index 701eb6d5e309..8ead38155cbd 100644 --- a/sys/security/mac_mls/mac_mls.c +++ b/sys/security/mac_mls/mac_mls.c @@ -1213,19 +1213,6 @@ mls_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel, mls_copy_effective(source, dest); } -static void -mls_mbuf_create_multicast_encap(struct mbuf *m, struct label *mlabel, - struct ifnet *ifp, struct label *ifplabel, struct mbuf *mnew, - struct label *mnewlabel) -{ - struct mac_mls *source, *dest; - - source = SLOT(mlabel); - dest = SLOT(mnewlabel); - - mls_copy_effective(source, dest); -} - static int mls_ipq_match(struct mbuf *m, struct label *mlabel, struct ipq *ipq, struct label *ipqlabel) @@ -2994,7 +2981,6 @@ static struct mac_policy_ops mls_ops = .mpo_inpcb_create_mbuf = mls_inpcb_create_mbuf, .mpo_bpfdesc_create_mbuf = mls_bpfdesc_create_mbuf, .mpo_ifnet_create_mbuf = mls_ifnet_create_mbuf, - .mpo_mbuf_create_multicast_encap = mls_mbuf_create_multicast_encap, .mpo_ipq_match = mls_ipq_match, .mpo_ifnet_relabel = mls_ifnet_relabel, .mpo_ipq_update = mls_ipq_update, diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c index 687378feda13..2cd3fb9f3674 100644 --- a/sys/security/mac_stub/mac_stub.c +++ b/sys/security/mac_stub/mac_stub.c @@ -418,14 +418,6 @@ stub_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel, } -static void -stub_mbuf_create_multicast_encap(struct mbuf *m, struct label *mlabel, - struct ifnet *ifp, struct label *ifplabel, struct mbuf *mnew, - struct label *mnewlabel) -{ - -} - static void stub_netatalk_aarp_send(struct ifnet *ifp, struct label *iflpabel, struct mbuf *m, struct label *mlabel) @@ -1551,7 +1543,6 @@ static struct mac_policy_ops stub_ops = .mpo_inpcb_create_mbuf = stub_inpcb_create_mbuf, .mpo_bpfdesc_create_mbuf = stub_bpfdesc_create_mbuf, .mpo_ifnet_create_mbuf = stub_ifnet_create_mbuf, - .mpo_mbuf_create_multicast_encap = stub_mbuf_create_multicast_encap, .mpo_netatalk_aarp_send = stub_netatalk_aarp_send, .mpo_netinet_arp_send = stub_netinet_arp_send, .mpo_netinet_firewall_reply = stub_netinet_firewall_reply, diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c index b0d4ea8a8763..39dc842bc2d0 100644 --- a/sys/security/mac_test/mac_test.c +++ b/sys/security/mac_test/mac_test.c @@ -1037,19 +1037,6 @@ test_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel, COUNTER_INC(ifnet_create_mbuf); } -COUNTER_DECL(mbuf_create_multicast_encap); -static void -test_mbuf_create_multicast_encap(struct mbuf *oldmbuf, - struct label *oldmbuflabel, struct ifnet *ifp, struct label *ifplabel, - struct mbuf *newmbuf, struct label *newmbuflabel) -{ - - LABEL_CHECK(oldmbuflabel, MAGIC_MBUF); - LABEL_CHECK(ifplabel, MAGIC_IFNET); - LABEL_CHECK(newmbuflabel, MAGIC_MBUF); - COUNTER_INC(mbuf_create_multicast_encap); -} - COUNTER_DECL(ipq_match); static int test_ipq_match(struct mbuf *fragment, struct label *fragmentlabel, @@ -2720,7 +2707,6 @@ static struct mac_policy_ops test_ops = .mpo_inpcb_create_mbuf = test_inpcb_create_mbuf, .mpo_bpfdesc_create_mbuf = test_bpfdesc_create_mbuf, .mpo_ifnet_create_mbuf = test_ifnet_create_mbuf, - .mpo_mbuf_create_multicast_encap = test_mbuf_create_multicast_encap, .mpo_ipq_match = test_ipq_match, .mpo_netatalk_aarp_send = test_netatalk_aarp_send, .mpo_netinet_arp_send = test_netinet_arp_send, -- cgit v1.2.3