Subject: Re: m_pulldown()
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Matt Thomas <matt@3am-software.com>
List: tech-net
Date: 12/01/1999 22:44:59
At 10:12 PM 12/1/99 , der Mouse wrote:
> >>         a function called m_pulldown().  KAME code is under migration to use
>
> > No offense, but m_pullup should die.  m_pulldown is a further
> > extension of this horror.
>
> > Appropriate use of m_copydata is a much better alternative.
>
>Why?  What's wrong with m_pullup()?  Why is it better to always copy
>data than to point to existing data when possible, copying only when
>necessary?  I thought avoiding copies was a Good Thing.
>
>(This is a serious question, not a challenge; I'm certainly open to
>being convinced.  I just don't see anything inherently wrong with
>m_pullup().)

One reason: m_pullup can fail.  And then you lose the packet.

there's no reason why you can't point to existing data, but if you
can't then m_copydata to a local buffer on the stack.
-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message