cvs commit: src/sys/conf options src/sys/netinet ip_output.c

Bosko Milekic bmilekic at unixdaemons.com
Thu Mar 27 09:39:58 PST 2003


See attached.  Similar logic may be applied to m_dup_pkthdr().

On Thu, Mar 27, 2003 at 05:58:00PM +0100, Maxime Henrion wrote:
> Bosko Milekic wrote:
> > 
> > Can you please still use m_gethdr() or m_getcl() to do the allocations
> > in the defragment function?  Similarly, for > MCLBYTES, use m_getm().
> > Don't roll your own.
> 
> Please see my reply to Mike for the first version of his patch.  He
> couldn't do this because m_dup_pkthdr() has a KASSERT() that makes it
> panic if we have a cluster attached to the mbuf.
> 
> Cheers,
> Maxime
> 

-- 
Bosko Milekic
bmilekic at unixdaemons.com
bmilekic at FreeBSD.org

-------------- next part --------------
--- /usr/src/sys.old/kern/uipc_mbuf.c	Wed Mar  5 18:37:41 2003
+++ /usr/src/sys/kern/uipc_mbuf.c	Thu Mar  6 18:16:06 2003
@@ -79,14 +79,15 @@
 	    ("m_move_pkthdr: called on non-header"));
 	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"));
+#endif
 #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;		/* especially tags */
 #ifdef MAC
 	mac_init_mbuf(to, 1);			/* XXXMAC no way to fail */


More information about the cvs-src mailing list