adapter: Fix advertising monitor on Linux 5.12-5.17
authorAndrew Drake <adrake@adrake.org>
Thu, 30 Jun 2022 07:39:58 +0000 (00:39 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commit5cb23f1ae6f3ed71bb67991888107014ea309759
tree4e21cceb635f169385ae04890773cc03e4283465
parentebc1aeb5bb6629fbe24d37badb4bcfd465408d93
adapter: Fix advertising monitor on Linux 5.12-5.17

The existing code assumes that, if a device supports advertising monitor
offload, DEVICE_FOUND events can be ignored since the kernel will send
ADV_MONITOR_DEVICE_FOUND events instead. Unfortunately, these new events
were added in 5.18, but offload was added in 5.12. This patch adds a
check on the MGMT API version so we can process the older DEVICE_FOUND
events when the new events are not supported.

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