summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-03-24 16:38:55 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-03-27 13:56:48 -0700
commit2719bb5aaf6df77edb4bf7c2654c178836300c73 (patch)
tree8fe1d9a9114f23833142756da7b072d9e0766f72 /monitor
parentcf72428156689a7bf2e2c6013788fedca08c6ff7 (diff)
downloadbluez-2719bb5aaf6df77edb4bf7c2654c178836300c73.tar.gz
monitor/att: Fix not loading gatt_db for devices using RPA
Device using RPA have its storage using its identity address so this uses keys_resolve_identity to attempt to resolve the destination address instead of always using the connection address.
Diffstat (limited to 'monitor')
-rw-r--r--monitor/att.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/monitor/att.c b/monitor/att.c
index 35a1fd066..ff77620c5 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -42,6 +42,7 @@
#include "display.h"
#include "l2cap.h"
#include "att.h"
+#include "keys.h"
struct att_read {
struct gatt_db_attribute *attr;
@@ -2807,9 +2808,14 @@ static void load_gatt_db(struct packet_conn_data *conn)
char filename[PATH_MAX];
char local[18];
char peer[18];
+ uint8_t id[6], id_type;
ba2str((bdaddr_t *)conn->src, local);
- ba2str((bdaddr_t *)conn->dst, peer);
+
+ if (keys_resolve_identity(conn->dst, id, &id_type))
+ ba2str((bdaddr_t *)id, peer);
+ else
+ ba2str((bdaddr_t *)conn->dst, peer);
create_filename(filename, PATH_MAX, "/%s/attributes", local);
gatt_load_db(data->ldb, filename, &data->ldb_mtim);