mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
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>
This commit is contained in:
parent
ca06707022
commit
a10e146676
2 changed files with 9 additions and 9 deletions
|
|
@ -199,7 +199,7 @@ struct llc_pdu_sn {
|
|||
u8 ssap;
|
||||
u8 ctrl_1;
|
||||
u8 ctrl_2;
|
||||
};
|
||||
} __packed;
|
||||
|
||||
static inline struct llc_pdu_sn *llc_pdu_sn_hdr(struct sk_buff *skb)
|
||||
{
|
||||
|
|
@ -211,7 +211,7 @@ struct llc_pdu_un {
|
|||
u8 dsap;
|
||||
u8 ssap;
|
||||
u8 ctrl_1;
|
||||
};
|
||||
} __packed;
|
||||
|
||||
static inline struct llc_pdu_un *llc_pdu_un_hdr(struct sk_buff *skb)
|
||||
{
|
||||
|
|
@ -359,7 +359,7 @@ struct llc_xid_info {
|
|||
u8 fmt_id; /* always 0x81 for LLC */
|
||||
u8 type; /* different if NULL/non-NULL LSAP */
|
||||
u8 rw; /* sender receive window */
|
||||
};
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
* llc_pdu_init_as_xid_cmd - sets bytes 3, 4 & 5 of LLC header as XID
|
||||
|
|
@ -415,7 +415,7 @@ struct llc_frmr_info {
|
|||
u8 curr_ssv; /* current send state variable val */
|
||||
u8 curr_rsv; /* current receive state variable */
|
||||
u8 ind_bits; /* indicator bits set with macro */
|
||||
};
|
||||
} __packed;
|
||||
|
||||
extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type);
|
||||
extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value);
|
||||
|
|
|
|||
Loading…
Reference in a new issue