cvs commit: src/sys/net if_bridge.c
thompsa at freebsd.org
Thu Aug 11 22:54:04 GMT 2005
On Fri, Aug 12, 2005 at 12:32:27AM +0200, Max Laier wrote:
> On Thursday 11 August 2005 22:57, Andrew Thompson wrote:
> > thompsa 2005-08-11 20:57:59 UTC
> > FreeBSD src repository
> > Modified files: (Branch: RELENG_6)
> > sys/net if_bridge.c
> > Log:
> > MFC: if_bridge.c, r.1.5
> > > Use m_copypacket() which is an optimization of the common case
> > > m_copym(m, 0, M_COPYALL, how).
> > >
> > > This is required for strict alignment architectures where we align the
> > > IP header in the input path but m_copym() will create an unaligned copy
> > > in bridge_broadcast(). m_copypacket() preserves alignment of the first
> > > mbuf.
> I guess we should document this difference between m_copym and m_copypacket ?!
It is in the comment block which is how I discovered it, but mbuf(9) is missing
the info about alignment.
* Copy an entire packet, including header (which must be present).
* An optimization of the common case `m_copym(m, 0, M_COPYALL, how)'.
* Note that the copy is read-only, because clusters are not copied,
* only their reference counts are incremented.
* Preserve alignment of the first mbuf so if the creator has left
* some room at the beginning (e.g. for inserting protocol headers)
* the copies still have the room available.
struct mbuf *
m_copypacket(struct mbuf *m, int how)
More information about the cvs-src