Subject: Re: disable m_dup()
To: Jun-ichiro itojun Hagino <>
From: Darren Reed <>
List: tech-net
Date: 08/19/2000 00:11:52
In some email I received from Jun-ichiro itojun Hagino, sie wrote:
> 	i found rather serious false assumption in sys/kern/uipc_mbuf.c:m_dup().
> 	i would like to disable the function for safety (wrap by #if 0).
> 	are there anyone using the function?
> 	the false assumption: if a mbuf has M_EXT bit raised,
> 	m_ext.ext_siz == MCLBYTES (cluster memory region allocated via MCLGET).
> 	the assumption does not hold

So are you saying that code like this is wrong ?

                MCLGET(m, M_DONTWAIT);
                if ((m->m_flags & M_EXT) == 0) {
                        return ENOBUFS;
                avail = (m->m_flags & M_EXT) ? MCLBYTES : MHLEN;

If it is, what is correct here ?