Subject: Re: Patch to make upper-layer network protocols align as needed
To: None <thorpej@wasabisystems.com>
From: Matt Thomas <matt@3am-software.com>
List: tech-net
Date: 05/11/2002 11:18:28
At 11:04 AM 5/11/2002, Jason R Thorpe wrote:
>One of the assumptions our network stack makes is that the IP headers
>will be aligned to a 32-bit boundary when ip_input() is called. This
>places a constraint on drivers -- they must arrange for the packet to
>be plopped into memory this way. For Ethernet, this means scooting
>the packet forward 2 bytes from the start of the receive buffer, so that
>the IP header is suitably aligned after the 14 byte Ethernet header.
>
>Patch is attached. Please comment.
Rather than doing
if (!aligned)
m_slurp
else if (too small)
m_pullup
I'd rather see:
if (!aligned || too small)
m_slurp
Also, any reason why (eventually) m_slurp could not be substituted for
all current uses of m_pullup?
--
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