shared/gatt-db: Fix gatt_db_attribute_get_index
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 1 Apr 2022 21:32:53 +0000 (14:32 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commit44e835035dbebbcece5fc85fbd2ef4790b3c70b3
treebe515f8870488a779191e106289bb1a4fdaeb52c
parenta0ef4395b0ca33cade2df172a24fa7523e07d6b8
shared/gatt-db: Fix gatt_db_attribute_get_index

gatt_db_attribute_get_index was calculating the index based on
attrib->handle - service->attributes[0]->handle which doesn't work when
there are gaps in between handles.

Fixes: https://github.com/bluez/bluez/issues/326
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/gatt-db.c