This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit e46fdc90e0b4183ee87d37e8746170f9b2a2b25b Author: Andrzej Kaczmarek <[email protected]> AuthorDate: Mon Jun 17 15:28:10 2019 +0200 nimble/ll: Fix peer address check with privacy We should explicitly chceck if AdvA is identity instead of just comparing address types. Comparing address types can give incorrect result if peer identity address is static random since both static random and RPA are random addresses. --- nimble/controller/src/ble_ll_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c index 8721f1e..342d0f8 100644 --- a/nimble/controller/src/ble_ll_conn.c +++ b/nimble/controller/src/ble_ll_conn.c @@ -2524,7 +2524,7 @@ ble_ll_conn_is_peer_adv(uint8_t addr_type, uint8_t *adva, int index) /* Fall-through intentional */ case BLE_HCI_CONN_PEER_ADDR_PUBLIC: case BLE_HCI_CONN_PEER_ADDR_RANDOM: - if (addr_type == connsm->peer_addr_type) { + if (ble_ll_addr_is_id(adva, addr_type)) { #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) /* Peer uses its identity address. Let's verify privacy mode. *
