Subject: Re: patch to align ip headers..
To: None <thorpej@zembu.com>
From: Perry E. Metzger <perry@piermont.com>
List: tech-net
Date: 04/29/2000 17:58:10
Jason R Thorpe <thorpej@zembu.com> writes:
> On Wed, Apr 26, 2000 at 11:30:19AM +0900, itojun@iijlab.net wrote:
>
> > >>+ if (mtod(m, intptr_t) & 0x3) {
> > >>+ intptr_t i = mtod(m, intptr_t) & 0x3;
> > >>+ bcopy(m->m_data, m->m_data - i, m->m_len);
> > >Since the arguments overlap, that should be ovbcopy.
> >
> > just to be sure: there's no ovbcopy in the kernel any more.
> > bcopy in the kernel is safe against overlap. (sys/lib/libkern/bcopy.c)
>
> Better yet... memmove()! But I'm still not certain that this is actually
> what we want to do.
We made the decision a long time ago to purge the b* functions and
replace them with mem* functions.
The specific reason that we did not do so with code in net*/ was to
make it easier for us to merge stuff like the KAME code.
I'd therefore say your impulse to say "memmove()!" is in fact correct.
--
Perry Metzger perry@piermont.com
--
"Ask not what your country can force other people to do for you..."