Subject: Re: disable m_dup()
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-net
Date: 08/18/2000 09:36:00
On Sat, Aug 19, 2000 at 12:11:52AM +1000, Darren Reed wrote:

 > So are you saying that code like this is wrong ?
 > 
 >                 MCLGET(m, M_DONTWAIT);
 >                 if ((m->m_flags & M_EXT) == 0) {
 >                         m_freem(m);
 >                         return ENOBUFS;
 >                 }
 >                 avail = (m->m_flags & M_EXT) ? MCLBYTES : MHLEN;
 > 
 > If it is, what is correct here ?

A cluster will have M_EXT set, but M_EXT may also be set for non-cluster
external storage.  If you know you MCLGET() and M_EXT is set afterwards,
then yes, MCLBYTES is "correct".

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>