]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
UBSan: Pack MACsec peer id structure
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 11:54:33 +0000 (13:54 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:48:49 +0000 (19:48 +0200)
This is needed to avoid an UBSan warning and since this struct is used
as part of a message construction, it needs to be packed anyway to
guarantee correct functionality.

ieee802_1x_kay.c:1021:3: runtime error: member access within misaligned address 0x0000031921e2 for type 'struct ieee802_1x_mka_peer_id', which requires 4 byte alignment

Signed-off-by: Jouni Malinen <j@w1.fi>
src/pae/ieee802_1x_kay_i.h

index 1d1589cb61e791bd43d975a14a128544499345b0..f9cd3f41b093b311de09788c6ac8028c2e6fb6f2 100644 (file)
@@ -39,7 +39,7 @@ struct ieee802_1x_kay;
 struct ieee802_1x_mka_peer_id {
        u8 mi[MI_LEN];
        be32 mn;
-};
+} STRUCT_PACKED;
 
 struct ieee802_1x_kay_peer {
        struct ieee802_1x_mka_sci sci;