aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2003-04-14 20:39:06 +0000
committerRobert Watson <rwatson@FreeBSD.org>2003-04-14 20:39:06 +0000
commit225bff6f8b02e48732b0ecbfe4b9c0f44905f445 (patch)
tree4a1b631e9b980e33ec2ea5040a1b9787eeda9f33 /sys/kern/uipc_mbuf.c
parentb85add5f317cae6bb1d736c3984006d17a1ab16d (diff)
downloadsrc-225bff6f8b02e48732b0ecbfe4b9c0f44905f445.tar.gz
src-225bff6f8b02e48732b0ecbfe4b9c0f44905f445.zip
Notes
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 55d828df28ee..08a7246409ef 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -88,21 +88,21 @@ m_move_pkthdr(struct mbuf *to, struct mbuf *from)
#if 0
/* see below for why these are not enabled */
M_ASSERTPKTHDR(to);
+ /* Note: with MAC, this may not be a good assertion. */
KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags),
("m_move_pkthdr: to has tags"));
#endif
KASSERT((to->m_flags & M_EXT) == 0, ("m_move_pkthdr: to has cluster"));
#ifdef MAC
+ /*
+ * XXXMAC: It could be this should also occur for non-MAC?
+ */
if (to->m_flags & M_PKTHDR)
- mac_destroy_mbuf(to);
+ m_tag_delete_chain(to, NULL);
#endif
to->m_flags = from->m_flags & M_COPYFLAGS;
to->m_data = to->m_pktdat;
to->m_pkthdr = from->m_pkthdr; /* especially tags */
-#ifdef MAC
- mac_init_mbuf(to, 1); /* XXXMAC no way to fail */
- mac_create_mbuf_from_mbuf(from, to);
-#endif
SLIST_INIT(&from->m_pkthdr.tags); /* purge tags from src */
from->m_flags &= ~M_PKTHDR;
}
@@ -125,20 +125,17 @@ m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how)
* assertions to trip. For now just disable them.
*/
M_ASSERTPKTHDR(to);
+ /* Note: with MAC, this may not be a good assertion. */
KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags), ("m_dup_pkthdr: to has tags"));
#endif
#ifdef MAC
if (to->m_flags & M_PKTHDR)
- mac_destroy_mbuf(to);
+ m_tag_delete_chain(to, NULL);
#endif
to->m_flags = (from->m_flags & M_COPYFLAGS) | (to->m_flags & M_EXT);
if ((to->m_flags & M_EXT) == 0)
to->m_data = to->m_pktdat;
to->m_pkthdr = from->m_pkthdr;
-#ifdef MAC
- mac_init_mbuf(to, 1); /* XXXMAC no way to fail */
- mac_create_mbuf_from_mbuf(from, to);
-#endif
SLIST_INIT(&to->m_pkthdr.tags);
return (m_tag_copy_chain(to, from, MBTOM(how)));
}
@@ -158,12 +155,8 @@ m_prepend(struct mbuf *m, int len, int how)
m_freem(m);
return (NULL);
}
- if (m->m_flags & M_PKTHDR) {
+ if (m->m_flags & M_PKTHDR)
M_MOVE_PKTHDR(mn, m);
-#ifdef MAC
- mac_destroy_mbuf(m);
-#endif
- }
mn->m_next = m;
m = mn;
if (len < MHLEN)