From ffd15131d2cbef4c17223f5b44e4808669c4d04e Mon Sep 17 00:00:00 2001 From: Jim Luther Date: Fri, 29 May 2020 14:50:22 +0200 Subject: [PATCH] bluetooth: host: fix unpacked l2cap struct The bt_l2cap_le_conn_rsp struct in l2cap_internal.h has not been declared __packed. This can cause alignment problems on some platforms if the struct is placed on an unaligned address. A __packed declaration solves this issue by forcing the compiler to use store instructions that do not required alignment. Signed-off-by: Jim Luther --- subsys/bluetooth/host/l2cap_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index a5abecd822d..af9dd7db8b7 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -183,7 +183,7 @@ struct bt_l2cap_le_conn_rsp { u16_t mps; u16_t credits; u16_t result; -}; +} __packed; #define BT_L2CAP_LE_CREDITS 0x16 struct bt_l2cap_le_credits {