Subject: Re: clear m_pkthdr on MGETHDR()
To: Jun-ichiro itojun Hagino <itojun@iijlab.net>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-net
Date: 05/31/2001 22:47:43
On Fri, Jun 01, 2001 at 02:05:03PM +0900, Jun-ichiro itojun Hagino wrote:
> is it okay if we clear out m_pkthdr on MGETHDR()? there's noone
> initializes these fields at this moment.
Can we at least use memset() so that the compiler might in-line it?
Or maybe we can in-line it ourselves?
> Index: mbuf.h
> ===================================================================
> RCS file: /cvsroot/kame/kame/netbsd/sys/sys/mbuf.h,v
> retrieving revision 1.22
> diff -u -r1.22 mbuf.h
> --- mbuf.h 2000/12/02 04:53:43 1.22
> +++ mbuf.h 2001/06/01 05:06:07
> @@ -252,7 +252,7 @@
> (m)->m_nextpkt = (struct mbuf *)NULL; \
> (m)->m_data = (m)->m_pktdat; \
> (m)->m_flags = M_PKTHDR; \
> - (m)->m_pkthdr.aux = (struct mbuf *)NULL; \
> + bzero(&(m)->m_pkthdr, sizeof((m)->m_pkthdr)); \
> } else \
> (m) = m_retryhdr((how), (type)); \
> } while (0)
--
-- Jason R. Thorpe <thorpej@zembu.com>