summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-03-28 05:57:48 +0000
committersilby <silby@FreeBSD.org>2003-03-28 05:57:48 +0000
commit430664f150d08628133cf598cd087e81248f6efd (patch)
tree387f7ac325e8fe8719597123667d5ca6b0df3075 /sys/kern
parentb399d5ecbd4716ab7d85123d538e0eac2cfecdec (diff)
downloadFreeBSD-src-430664f150d08628133cf598cd087e81248f6efd.zip
FreeBSD-src-430664f150d08628133cf598cd087e81248f6efd.tar.gz
Allow m_dup_pkthdr to accept mbufs with attached clusters as
targets. Submitted by: bmilekic
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_mbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index c94558f..670a4b6 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -116,13 +116,13 @@ m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how)
KASSERT(to->m_flags & M_PKTHDR, ("m_dup_pkthdr: called on non-header"));
KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags), ("m_dup_pkthdr: to has tags"));
#endif
- KASSERT((to->m_flags & M_EXT) == 0, ("m_dup_pkthdr: to has cluster"));
#ifdef MAC
if (to->m_flags & M_PKTHDR)
mac_destroy_mbuf(to);
#endif
- to->m_flags = from->m_flags & M_COPYFLAGS;
- to->m_data = to->m_pktdat;
+ 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 */
OpenPOWER on IntegriCloud