diff options
author | Vitalii Demianets <vitas@nppfactor.kiev.ua> | 2011-05-12 23:04:29 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-13 15:13:24 -0400 |
commit | a10e14667635dde504ed9e7ee851494c2cf2ae8e (patch) | |
tree | bf5ad736713e1fcb80fadb05825184b44d50c87e /drivers/net/bonding/bond_3ad.h | |
parent | ca06707022d6ba4744198a8ebbe4994786b0c613 (diff) | |
download | blackbird-op-linux-a10e14667635dde504ed9e7ee851494c2cf2ae8e.tar.gz blackbird-op-linux-a10e14667635dde504ed9e7ee851494c2cf2ae8e.zip |
bonding,llc: Fix structure sizeof incompatibility for some PDUs
With some combinations of arch/compiler (e.g. arm-linux-gcc) the sizeof
operator on structure returns value greater than expected. In cases when the
structure is used for mapping PDU fields it may lead to unexpected results
(such as holes and alignment problems in skb data). __packed prevents this
undesired behavior.
Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.h')
-rw-r--r-- | drivers/net/bonding/bond_3ad.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index b28baff70864..01b8a6af275b 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h @@ -39,7 +39,7 @@ typedef struct mac_addr { u8 mac_addr_value[ETH_ALEN]; -} mac_addr_t; +} __packed mac_addr_t; enum { BOND_AD_STABLE = 0, @@ -134,12 +134,12 @@ typedef struct lacpdu { u8 tlv_type_terminator; // = terminator u8 terminator_length; // = 0 u8 reserved_50[50]; // = 0 -} lacpdu_t; +} __packed lacpdu_t; typedef struct lacpdu_header { struct ethhdr hdr; struct lacpdu lacpdu; -} lacpdu_header_t; +} __packed lacpdu_header_t; // Marker Protocol Data Unit(PDU) structure(43.5.3.2 in the 802.3ad standard) typedef struct bond_marker { @@ -155,12 +155,12 @@ typedef struct bond_marker { u8 tlv_type_terminator; // = 0x00 u8 terminator_length; // = 0x00 u8 reserved_90[90]; // = 0 -} bond_marker_t; +} __packed bond_marker_t; typedef struct bond_marker_header { struct ethhdr hdr; struct bond_marker marker; -} bond_marker_header_t; +} __packed bond_marker_header_t; #pragma pack() |