MKA: Mark frame structs packed

Mark the data structures used in construction/parsing frames packed to
prevent compiler from being able to pad them.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2018-12-25 16:31:46 +02:00
parent 91ad2f441a
commit f1ac2b8e6a
2 changed files with 10 additions and 10 deletions

View file

@ -38,7 +38,7 @@ struct ieee802_1x_mka_ki {
struct ieee802_1x_mka_sci {
u8 addr[ETH_ALEN];
be16 port;
};
} STRUCT_PACKED;
struct mka_key {
u8 key[MAX_KEY_LEN];

View file

@ -165,7 +165,7 @@ struct ieee802_1x_mka_hdr {
#endif
/* octet 4 */
u8 length1;
};
} STRUCT_PACKED;
#define MKA_HDR_LEN sizeof(struct ieee802_1x_mka_hdr)
@ -212,7 +212,7 @@ struct ieee802_1x_mka_basic_body {
/* followed by CAK Name */
u8 ckn[0];
};
} STRUCT_PACKED;
/**
* struct ieee802_1x_mka_peer_body - Live Peer List and Potential Peer List
@ -238,9 +238,9 @@ struct ieee802_1x_mka_peer_body {
/* octet 4 */
u8 length1;
u8 peer[0];
/* followed by Peers */
};
u8 peer[0];
} STRUCT_PACKED;
/**
* struct ieee802_1x_mka_sak_use_body - MACsec SAK Use parameter set (Figure
@ -315,7 +315,7 @@ struct ieee802_1x_mka_sak_use_body {
be32 okn;
/* octet 41 - 44 */
be32 olpn;
};
} STRUCT_PACKED;
/**
* struct ieee802_1x_mka_dist_sak_body - Distributed SAK parameter set
@ -362,7 +362,7 @@ struct ieee802_1x_mka_dist_sak_body {
* for other cipher suite: octet 9-16: cipher suite id, octet 17-: SAK
*/
u8 sak[0];
};
} STRUCT_PACKED;
/**
* struct ieee802_1x_mka_dist_cak_body - Distributed CAK parameter set (Figure
@ -398,7 +398,7 @@ struct ieee802_1x_mka_dist_cak_body {
/* followed by CAK Name, 29- */
u8 ckn[0];
};
} STRUCT_PACKED;
struct ieee802_1x_mka_icv_body {
/* octet 1 */
@ -418,6 +418,6 @@ struct ieee802_1x_mka_icv_body {
/* octet 5 - */
u8 icv[0];
};
} STRUCT_PACKED;
#endif /* IEEE802_1X_KAY_I_H */