batman-adv: Use packing of 2 for all headers before an ethernet header
authorSven Eckelmann <sven@narfation.org>
Mon, 5 Nov 2012 20:25:27 +0000 (21:25 +0100)
committerAntonio Quartulli <ordex@autistici.org>
Wed, 21 Nov 2012 11:35:47 +0000 (12:35 +0100)
commite022b956c11084f3ee1c6ece523e14ac07b7c645
tree70651b228c9761e765d4805e42b885411043cad4
parentd81f78ec37ecad3a4cc0a71d0ea1f74994ec5cda
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.

A packing of 2 is necessary to avoid extra padding at the end of the struct
caused by a structure member which is larger than two bytes. Otherwise the
structure would not fulfill the previously mentioned rule to avoid the
misalignment of the payload after the ethernet header. It may also lead to
leakage of information when the padding it not initialized before sending.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
net/batman-adv/packet.h