Add one further check with mac_policy_count to an mbuf copying case

(limited to netatalk) to avoid MAC label lookup on both mbufs if no
policies are registered.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2009-06-03 19:41:12 +00:00
parent 506a380d0f
commit 3ad3d9c5ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193393

View File

@ -258,6 +258,9 @@ mac_mbuf_copy(struct mbuf *m_from, struct mbuf *m_to)
{
struct label *src_label, *dest_label;
if (mac_policy_count == 0)
return;
src_label = mac_mbuf_to_label(m_from);
dest_label = mac_mbuf_to_label(m_to);