Skip to content

Commit

Permalink
batman-adv: fix alignment for batadv_coded_packet
Browse files Browse the repository at this point in the history
The compiler may decide to pad the structure, and then it does not
have the expected size of 46 byte. Fix this by moving it in the
pragma pack(2) part of the code.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
  • Loading branch information
Simon Wunderlich authored and Antonio Quartulli committed Dec 28, 2013
1 parent 6a9eadc commit 46b76e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/batman-adv/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ struct batadv_bcast_packet {
*/
};

#pragma pack()

/**
* struct batadv_coded_packet - network coded packet
* @header: common batman packet header and ttl of first included packet
Expand Down Expand Up @@ -349,6 +347,8 @@ struct batadv_coded_packet {
__be16 coded_len;
};

#pragma pack()

/**
* struct batadv_unicast_tvlv - generic unicast packet with tvlv payload
* @header: common batman packet header
Expand Down

0 comments on commit 46b76e0

Please sign in to comment.