From 63887d19a87fe9b19677314ca05d82a972968b57 Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Mon, 23 Nov 2020 09:06:30 +0000 Subject: [PATCH] update the peer address when LTK has been found in old entry --- connectivity/FEATURE_BLE/source/generic/SecurityDb.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectivity/FEATURE_BLE/source/generic/SecurityDb.h b/connectivity/FEATURE_BLE/source/generic/SecurityDb.h index ea3b93ba7c..0383dfebca 100644 --- a/connectivity/FEATURE_BLE/source/generic/SecurityDb.h +++ b/connectivity/FEATURE_BLE/source/generic/SecurityDb.h @@ -190,6 +190,11 @@ public: SecurityDistributionFlags_t* flags = get_distribution_flags(correct_handle); flags->connected = true; + /* update peer address */ + SecurityDistributionFlags_t* old_flags = get_distribution_flags(*db_handle); + flags->peer_address = old_flags->peer_address; + flags->peer_address_is_public = old_flags->peer_address_is_public; + close_entry(*db_handle, false); *db_handle = correct_handle; cb(*db_handle, keys);