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