Skip to content

Commit 73b4beb

Browse files
add connection addresses to whitelist
1 parent bfdbcc7 commit 73b4beb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

features/FEATURE_BLE/ble/generic/SecurityDb.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,21 @@ class SecurityDb {
617617
continue;
618618
}
619619

620+
// Add the connection address
621+
whitelist->addresses[whitelist->size].address = flags->peer_address.data();
622+
623+
if (flags->peer_address_is_public) {
624+
whitelist->addresses[whitelist->size].type = peer_address_type_t::PUBLIC;
625+
} else {
626+
whitelist->addresses[whitelist->size].type = peer_address_type_t::RANDOM;
627+
}
628+
629+
whitelist->size++;
630+
if (whitelist->size == whitelist->capacity) {
631+
break;
632+
}
633+
634+
// Add the identity address
620635
SecurityEntryIdentity_t* identity = read_in_entry_peer_identity(db_handle);
621636
if (!identity) {
622637
continue;

0 commit comments

Comments
 (0)