nimble/ll: Fix unaligned access in addr resolver

ble_ll_resolv_rpa() casts IRK parameter to uint32_t* for faster access,
but this parameter is a pointer to member of struct ble_ll_resolv_entry
which is not word aligned thus it will hardfault on cm0.

This patch forces proper aligmnent of IRKs.
This commit is contained in:
Andrzej Kaczmarek
2019-10-23 22:48:18 +02:00
parent 766a41456a
commit 31f7f82d55
2 changed files with 2 additions and 0 deletions
@@ -35,6 +35,7 @@ struct ble_ll_resolv_entry
uint8_t rl_addr_type;
uint8_t rl_reserved;
uint8_t rl_priv_mode;
uint8_t _pad;
uint8_t rl_local_irk[16];
uint8_t rl_peer_irk[16];
uint8_t rl_identity_addr[BLE_DEV_ADDR_LEN];
+1
View File
@@ -43,6 +43,7 @@ struct ble_ll_resolv_data
};
struct ble_ll_resolv_data g_ble_ll_resolv_data;
__attribute__((aligned(4)))
struct ble_ll_resolv_entry g_ble_ll_resolv_list[MYNEWT_VAL(BLE_LL_RESOLV_LIST_SIZE)];
static int