[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7016771.yWLQhgLl2P@sven-laptop.home.narfation.org>
Date: Wed, 21 Nov 2012 14:51:02 +0100
From: Sven Eckelmann <sven@...fation.org>
To: David Laight <David.Laight@...lab.com>
Cc: Antonio Quartulli <ordex@...istici.org>, davem@...emloft.net,
netdev@...r.kernel.org, b.a.t.m.a.n@...ts.open-mesh.org,
Marek Lindner <lindner_marek@...oo.de>
Subject: Re: RE: [PATCH 9/9] batman-adv: Use packing of 2 for all headers before an ethernet header
On Wednesday 21 November 2012 13:36:54 David Laight wrote:
> > All packet headers in front of an ethernet header have to be completely
> > divisible by 2 but not by 4 to make the payload after the ethernet header
> > again 4 bytes boundary aligned.
>
> I'm not sure that statement is correct - whether the patches are
> correct rather depends on the actual packet format(s) you are
> generating/modifying.
>
> If you are adding data to an ethernet packet you'll need
> to add a multiple of 4 bytes in order maintain the alignment
> of the IP header (which needs to be 4 byte aligned and is
> usually 14 bytes from the start of the receive data).
>
> This means that the data you add probably has to be 4n+2
> aligned - since I guess you are adding between the source
> MAC address and ethertype?
> If you are inserting data after the ethertype (ie after some
> protocol identifier), then your header can be 4 byte aligned
> provided it ends with the replacement ethertype (0800 or 0806
> for IP protocols).
No, it looks like this
ethernet header | batman-adv stuff | ethernet header | ip header
Kind regards,
Sven
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists