Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit cc9fb912f01cf8069b1e4f131f2f93db52289b2d Author: Sven Eckelmann sven@narfation.org Date: Mon Nov 5 10:15:24 2012 +0100
batman-adv: Fix alignment for payload after batadv_unicast_4addr_packet
batadv_unicast_4addr_packet created an odd aligned ethernet header and a not 4 bytes boundary aligned IP header. Adding an extra reserved bytes avoids this problem.
This problem was introduced in 78fc6bbe0aca868b65b92723b1e259e7ef7b35c0 ("batman-adv: add UNICAST_4ADDR packet type")
Signed-off-by: Sven Eckelmann sven@narfation.org Signed-off-by: Marek Lindner lindner_marek@yahoo.de
cc9fb912f01cf8069b1e4f131f2f93db52289b2d packet.h | 6 +++++- unicast.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/packet.h b/packet.h index cef1b3f..1c5454d 100644 --- a/packet.h +++ b/packet.h @@ -204,7 +204,11 @@ struct batadv_unicast_4addr_packet { struct batadv_unicast_packet u; uint8_t src[ETH_ALEN]; uint8_t subtype; -} __packed; + uint8_t reserved; + /* "4 bytes boundary + 2 bytes" long to make the payload after the + * following ethernet header again 4 bytes boundary aligned + */ +};
struct batadv_unicast_frag_packet { struct batadv_header header; diff --git a/unicast.c b/unicast.c index 9416136..10aff49 100644 --- a/unicast.c +++ b/unicast.c @@ -374,6 +374,7 @@ bool batadv_unicast_4addr_prepare_skb(struct batadv_priv *bat_priv, memcpy(unicast_4addr_packet->src, primary_if->net_dev->dev_addr, ETH_ALEN); unicast_4addr_packet->subtype = packet_subtype; + unicast_4addr_packet->reserved = 0;
ret = true; out: