[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B70BB@saturn3.aculab.com>
Date: Wed, 21 Nov 2012 13:36:54 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "Antonio Quartulli" <ordex@...istici.org>, <davem@...emloft.net>
Cc: <netdev@...r.kernel.org>, <b.a.t.m.a.n@...ts.open-mesh.org>,
"Sven Eckelmann" <sven@...fation.org>,
"Marek Lindner" <lindner_marek@...oo.de>
Subject: RE: [PATCH 9/9] batman-adv: Use packing of 2 for all headers before an ethernet header
> 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).
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists