From cdec8e68651262419761c27ad99e2c22bc566ee6 Mon Sep 17 00:00:00 2001 From: Darshan Dobariya Date: Wed, 29 Nov 2023 18:02:18 +0530 Subject: [PATCH] fix(nimble): Fixed authcomplete failure caused by a mismatch in the c1 value --- nimble/host/src/ble_hs_hci_evt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c index d0b47d3c9..909353260 100644 --- a/nimble/host/src/ble_hs_hci_evt.c +++ b/nimble/host/src/ble_hs_hci_evt.c @@ -187,6 +187,8 @@ ble_hs_hci_evt_dispatch_find(uint8_t event_code) return NULL; } +static const uint8_t ble_hs_conn_null_addr[6]; + static ble_hs_hci_evt_le_fn * ble_hs_hci_evt_le_dispatch_find(uint8_t event_code) { @@ -457,7 +459,7 @@ ble_hs_hci_evt_le_enh_conn_complete(uint8_t subevent, const void *data, #if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY) /* RPA needs to be resolved here, as controller is not aware of the * address is RPA in Host based RPA */ - if (ble_host_rpa_enabled()) { + if (ble_host_rpa_enabled() && !memcmp(evt.local_rpa, ble_hs_conn_null_addr, 6) == 0) { uint8_t *local_id_rpa = ble_hs_get_rpa_local(); memcpy(evt.local_rpa, local_id_rpa, BLE_DEV_ADDR_LEN); }