host: Fix conn find by RPA address
When argument address is RPA then compare with peer rpa address field.
@@ -300,10 +300,16 @@ ble_hs_conn_find_by_addr(const ble_addr_t *addr)
}
SLIST_FOREACH(conn, &ble_hs_conns, bhc_next) {
+ if (BLE_ADDR_IS_RPA(addr)) {
+ if (ble_addr_cmp(&conn->bhc_peer_rpa_addr, addr) == 0) {
+ return conn;
+ }
+ } else {
if (ble_addr_cmp(&conn->bhc_peer_addr, addr) == 0) {
return conn;
}
}
+ }
return NULL;
}
